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

Disable metrics buckets #31

Open
flaviostutz opened this issue May 12, 2021 · 6 comments
Open

Disable metrics buckets #31

flaviostutz opened this issue May 12, 2021 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@flaviostutz
Copy link
Member

Only more advanced users of Prometheus metrics really uses buckets/histograms. By removing metrics buckets, we will reduce in over 60% the amount of processing and byte output in our metrics endpoint with no loss in quality.

Currently we have something like this for each metrics/label combination:

request_seconds_bucket 1
request_seconds_bucket 2
request_seconds_bucket 3
request_seconds_bucket 4
request_seconds_bucket +inf
request_seconds_sum
request_seconds_count
response_size_bytes

By removing buckets, we would reduce to something like

request_seconds_sum
request_seconds_count
response_size_bytes

Proposal

  • Disable buckets output by default (will only generate _sum and _count metrics for each request)
  • Only enable buckets if configured explicitly using existing param "buckets"
<init-param>
    <param-name>buckets</param-name>
    <param-value>0.1,0.3,2,10</param-value>
</init-param>
@flaviostutz flaviostutz changed the title Allow metrics buckets disable Disable metrics buckets May 12, 2021
@flaviostutz flaviostutz added enhancement New feature or request help wanted Extra attention is needed labels May 12, 2021
@gilliardmacedo
Copy link
Member

@flaviostutz I agree with the topic but I'm concerned about solution: We have a big brother protocol implementation and the protocol defines this metrics. Default use of servlet-monitor will become "not-big-brother-compliant". Maybe a protocol discusion? Besides that, a present servlet-monitor user will lose features when simply upgrading lib(and without protocol upgrade)?

@flaviostutz
Copy link
Member Author

flaviostutz commented May 12, 2021 via email

@CarlosPanarello
Copy link

Maybe in this case we need to add a new metric, like simple_ request_seconds. With this we can use both metrics in cases that we need a histogram and some cases we need just a simple count with average time info.
Because if we change this the dashboards created expecting a histogram will be broken.

@flaviostutz
Copy link
Member Author

flaviostutz commented May 13, 2021 via email

@CarlosPanarello
Copy link

My suggestion is to have both metrics in the same time in the project. So you can choose two flavors of metrics with or without buckets, default it will be using without. For this we have to define another name for metric, because of this i said to use simple_ request_seconds.

@flaviostutz
Copy link
Member Author

We don't need both at the same time because buckets are only additional metrics (suffixed by "_bucket") to the same base metrics name.

For example, without buckets, it would be:
request_seconds_count
request_seconds_sum

When buckets are enabled, it will have those two metrics and, additionally:
request_seconds_bucket

So if we use two different names we won't have this kind of optimization in the number of metrics and will duplicate the base metrics (those suffixed by _count and _sum), which would be an unnecessary overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants