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

Export observed histogram values sum into prometheus #707

Open
DmitriyH opened this issue Oct 1, 2024 · 0 comments
Open

Export observed histogram values sum into prometheus #707

DmitriyH opened this issue Oct 1, 2024 · 0 comments

Comments

@DmitriyH
Copy link

DmitriyH commented Oct 1, 2024

Currently, Histogram doesn't have a method to get the observed values sum.
And when it is exported into prometheus format, _sum is absent.

For example:

userver::utils::statistics::Histogram test_histogram{std::vector<double>{1.0, 5.0, 10.0}};

test_metrics_test_histogram_bucket{le="1"} 2
test_metrics_test_histogram_bucket{le="5"} 6
test_metrics_test_histogram_bucket{le="10"} 11
test_metrics_test_histogram_bucket{le="+Inf"} 50
test_metrics_test_histogram_count{} 50

If the same histogram would be constructed from prometheus library, it would have additional line:

test_metrics_test_histogram_sum{} 1225

Value _sum is a standard part of prometheus histogram: https://prometheus.io/docs/concepts/metric_types/#histogram

It would be useful, if _sum will be implemented for prometheus histogram export.

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

No branches or pull requests

1 participant