Skip to content

Update native_histograms.md #2650

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

Closed
wants to merge 1 commit into from

Conversation

Vimal-Shashank
Copy link

The CounterResetHint should ideally be set to CounterReset rather than UnknownCounterReset.

#issue
Native histograms: zero sample of created timestamp should have counter reset hint

#close #16575

The CounterResetHint should ideally be set to CounterReset rather than UnknownCounterReset. 

Signed-off-by: Shashank vimal <[email protected]>
@krajorama krajorama self-requested a review May 30, 2025 06:18
@@ -1565,7 +1565,7 @@ trigger the detection of a spurious counter reset).

The counter reset information of the synthetic zero sample is always set to
`CounterReset`. (TODO: Currently, Prometheus probably sets it to
`UnknownCounterReset` for the first sample of a series, which is not wrong, but
`CounterResetHint` for the first sample of a series, which is not wrong, but
Copy link
Member

Choose a reason for hiding this comment

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

hi, thank you for taking interest, however CounterResetHint is not a valid value for the hint itself. Also the current code does indeed use UnknownCounterReset. This is because it's not actually setting any value which is the same: https://github.com/prometheus/prometheus/blob/24057883a14c597d70f46612e4b8fb5c9ad58d62/tsdb/head_append.go#L784

If you'd like to fix it, please start a PR in Prometheus to have it actually set CounterReset.

Copy link
Author

Choose a reason for hiding this comment

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

The counter reset information of the synthetic zero sample is always set to CounterReset. This ensures that the initial zero value of a histogram, created for counter reset detection, is explicitly marked as a reset and not left ambiguous. is this correct?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. That's what's written there. This TODO is already tracked as prometheus/prometheus#16575 . No reason to update the TODO. It will be removed anyway once prometheus/prometheus#16575 is solved.

@beorn7 beorn7 closed this Jun 4, 2025
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.

None yet

3 participants