Skip to content

Ensure metric name is present on histogram_quantile annotations#15828

Merged
beorn7 merged 3 commits intoprometheus:mainfrom
jhesketh:jhesketh/histogram_quantile_annotations
Jan 22, 2025
Merged

Ensure metric name is present on histogram_quantile annotations#15828
beorn7 merged 3 commits intoprometheus:mainfrom
jhesketh:jhesketh/histogram_quantile_annotations

Conversation

@jhesketh
Copy link
Contributor

Previously the series name label was dropped before the annotation was emitted causing the annotation message to have a blank value.

This fix also allows delayed name removal for classic histograms.

Fixes: #15411

Previously the series __name__ label was dropped before the annotation
was emitted causing the annotation message to have a blank value.

This fix also allows delayed name removal for classic histograms.

Fixes: prometheus#15411
Signed-off-by: Joshua Hesketh <josh@nitrotech.org>
This annotation could be split into two to be clearer for the user
(one for missing, and one for malformed). This is outside of the scope
of this change.

Signed-off-by: Joshua Hesketh <josh@nitrotech.org>
@jhesketh jhesketh force-pushed the jhesketh/histogram_quantile_annotations branch from b1ee4a8 to 28e37c7 Compare January 15, 2025 12:27
@beorn7 beorn7 self-requested a review January 21, 2025 13:29
Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

Very nice. Just my usual nit about a missing period (I'll submit the suggestion before merging, so no need for you to fix it).

I really like that this also fixes the delayed name removal for classic histograms. (I wasn't aware that it didn't work.)

The sad news is that the metric name will still be missing in the annotations in the very common case that you first rate the histogram before applying histogram_quantile, while not having --enable-feature=promql-delayed-name-removal activated. Currently, I see no easy way of fixing that. But maybe it's fine "as is". I hope anyway that we can make delayed name removal the default for v4.

To be squashed.

Signed-off-by: Björn Rabenstein <github@rabenste.in>
@beorn7
Copy link
Member

beorn7 commented Jan 22, 2025

#15855 to make delayed name removal the default in v4.

@beorn7 beorn7 merged commit 665d1ba into prometheus:main Jan 22, 2025
25 checks passed
@jhesketh jhesketh deleted the jhesketh/histogram_quantile_annotations branch January 23, 2025 11:24
charleskorn added a commit to grafana/mimir that referenced this pull request May 5, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request May 16, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request May 16, 2025
* Upgrade mimir-prometheus

* Fix breaking change in `NewAPI`

* Sync upstream PromQL engine test cases

* Modify `histogram_stddev` and `histogram_stdvar` to match new behaviour introduced in prometheus/prometheus#16444

* Simplify code

* Remove outdated comment

This issue was fixed in prometheus/prometheus#15828.

* Remove unnecessary variable

* Rename operator and files

* Extract `histogram_quantile`-specific logic

* Add support for classic histograms in `histogram_fraction`

See prometheus/prometheus#16095

* Bring in changes from grafana/mimir-prometheus#871

* Invert build tag logic to match prometheus/prometheus#16436

* Sync query engine tests with upstream

* Fix breaking changes

* Regenerate OTLP code
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.

Forced monotonicity info annotation does not display metric name

2 participants