Skip to content

Update native_histograms.md#2650

Closed
Vimal-Shashank wants to merge 1 commit intoprometheus:mainfrom
Vimal-Shashank:patch-1
Closed

Update native_histograms.md#2650
Vimal-Shashank wants to merge 1 commit intoprometheus:mainfrom
Vimal-Shashank:patch-1

Conversation

@Vimal-Shashank
Copy link
Copy Markdown

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 <jamvimal706@gmail.com>
@krajorama krajorama self-requested a review May 30, 2025 06:18
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

3 participants