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

Allow the http_request_duration buckets to be configurable #6238

Closed
AdrianArnautu opened this issue Sep 22, 2023 · 1 comment · Fixed by #6239
Closed

Allow the http_request_duration buckets to be configurable #6238

AdrianArnautu opened this issue Sep 22, 2023 · 1 comment · Fixed by #6239

Comments

@AdrianArnautu
Copy link
Contributor

What is the underlying problem you're trying to solve?

http_request_duration has fixed, hardcoded number of buckets with no possibility to tweak them
see https://github.com/open-policy-agent/opa/blob/main/internal/prometheus/prometheus.go#L47

1e-6, // 1 microsecond
5e-6,
1e-5,
5e-5,
1e-4,
5e-4,
1e-3, // 1 millisecond
0.01,
0.1,
1, // 1 second

For cases when the most of the latencies are above 1ms, with only 4 available buckets we don't have a good insight on OPA's performance.
As a workaround, the client must to do the calculations.

Describe a "Good Enough" solution

Extend the OPA codebase to:

  • accept a configurable number of buckets
  • for this feature not to be a breaking change, we default to existing number of buckets if the configuration is missing

Additional Context

See this discussion: https://github.com/orgs/open-policy-agent/discussions/487

@AdrianArnautu
Copy link
Contributor Author

I've already started the work on this, I'll submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant