Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new consistency middleware for full-consistency-only callers #2109

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

josephschorr
Copy link
Member

Also adds a service label onto the metrics generated to allow for disambiguation where SpiceDB might be embedded

Also adds a service label onto the metrics generated to allow for disambiguation where SpiceDB might be embedded
@josephschorr josephschorr requested a review from a team as a code owner October 30, 2024 18:27
@github-actions github-actions bot added area/CLI Affects the command line area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Oct 30, 2024
ConsistentyCounter.WithLabelValues("minlatency", source).Inc()

if serviceLabel != "" {
ConsistentyCounter.WithLabelValues("minlatency", source, serviceLabel).Inc()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

// ForceFullConsistencyUnaryServerInterceptor returns a new unary server interceptor that enforces full consistency
// for all requests, except for those in the bypassServiceWhitelist.
func ForceFullConsistencyUnaryServerInterceptor(serviceLabel string) grpc.UnaryServerInterceptor {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use any instead of interface{}

@josephschorr josephschorr added this pull request to the merge queue Oct 30, 2024
Merged via the queue into authzed:main with commit 1423ebb Oct 30, 2024
22 checks passed
@josephschorr josephschorr deleted the consistency-middleware branch October 30, 2024 19:07
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/CLI Affects the command line area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants