Skip to content

storage: add metrics for NH to classic conversion - #20277

Open
rbizos wants to merge 4 commits into
prometheus:mainfrom
rbizos:feature/native_histograms_compat_layer_metrics
Open

rbizos wants to merge 4 commits into
prometheus:mainfrom
rbizos:feature/native_histograms_compat_layer_metrics

Conversation

@rbizos

@rbizos rbizos commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Add prometheus_engine_query_classic_histogram_series_total to count classic-format histogram series returned by selectors, labeled by their source (classic or nhcb).

The counter increments once per returned series, not once per sample or observation. It also counts matching _count and _sum series. If in the future we introduce NH with exponential buckets we can add a label value from=nh

Example

For example, suppose a selector returns one classic histogram with two matching bucket series, and converts one NHCB histogram with two finite bounds into three bucket series (including +Inf). After iterating the results, the metric could look like:

prometheus_engine_query_classic_histogram_series_total{from="classic"} 2
prometheus_engine_query_classic_histogram_series_total{from="nhcb"} 3
[FEATURE] Storage: Add a metric counting classic histogram series returned by queries, labeled by source.

@rbizos
rbizos force-pushed the feature/native_histograms_compat_layer_metrics branch from 75b4310 to 69271b5 Compare November 2, 2026 18:52
@rbizos
rbizos marked this pull request as ready for review November 3, 2026 08:34
@rbizos
rbizos requested review from a team, roidelapluie and vpranckaitis as code owners November 3, 2026 08:34
@rbizos

rbizos commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@bwplotka This one should be relatively simple :)

@bwplotka bwplotka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

neat! One non blocking question, otherwise LGTM!

Comment thread storage/native_histograms_as_classic.go Resolved
Signed-off-by: Raphael Bizos <[email protected]>
@rbizos

rbizos commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

It should be good now :)

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.

2 participants