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

Added a counter metric for errors #477

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

rudrakhp
Copy link
Contributor

@rudrakhp rudrakhp commented Nov 1, 2023

@rudrakhp rudrakhp force-pushed the add_error_counter branch 2 times, most recently from 8aca655 to 79ece7f Compare November 1, 2023 11:37
@@ -392,7 +411,7 @@ func (p *envoyExtAuthzGrpcServer) check(ctx context.Context, req interface{}) (*
}

if ctx.Err() != nil {
err = errors.Wrap(ctx.Err(), "check request timed out before query execution")
err = errors.Wrap(ctx.Err(), CheckRequestTimeoutErrorMessage)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] We should introduce our own error type here, and match on that type instead of the error message, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srenatus Thanks for the comment! I have tried to address this with minimal changes, please do review.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks! I'll review it tomorrow unless @ashutosh-narkar beats me to it.

@rudrakhp rudrakhp force-pushed the add_error_counter branch 6 times, most recently from da9e765 to c4ae67a Compare November 1, 2023 17:55
Copy link
Member

@ashutosh-narkar ashutosh-narkar left a comment

Choose a reason for hiding this comment

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

@rudrakhp the changes look good. There seems to be some repetition in the test cases. If we reduce that by moving out common logic, that could be helpful.

@rudrakhp rudrakhp force-pushed the add_error_counter branch 2 times, most recently from 8797fd3 to f07838f Compare November 3, 2023 08:50
@rudrakhp
Copy link
Contributor Author

rudrakhp commented Nov 3, 2023

Thanks for your comments @ashutosh-narkar ! Addressed them.

Signed-off-by: Rudrakh Panigrahi <rudrakh97@gmail.com>
Copy link
Member

@ashutosh-narkar ashutosh-narkar left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @rudrakhp!

@ashutosh-narkar ashutosh-narkar merged commit 7b50cd3 into open-policy-agent:main Nov 3, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have metrics dedicated to context cancelled/deadline exceeded
3 participants