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

Fix issue with histogram rendering #175

Merged
merged 2 commits into from
Jul 11, 2024
Merged

Fix issue with histogram rendering #175

merged 2 commits into from
Jul 11, 2024

Conversation

beorn7
Copy link
Member

@beorn7 beorn7 commented Jul 10, 2024

As it turns out, makeBuckets always returns at least the +Inf
bucket. So a native histogram will never be rendered. The canonical
way of marking a native histogram, even one without any observations
yet, is to have at least one span.

With this commit, a native histogram is rendered if there is at least
one span. Otherwise, a classic histogram is rendered.

I have also made the documentation a bit more explicit about this and re-added a classic histogram example.

As it turns out, `makeBuckets` always returns at least the +Inf
bucket. So a native histogram will never be rendered. The canonical
way of marking a native histogram, even one without any observations
yet, is to have at least one span.

With this commit, a native histogram is rendered if there is at least
one span. Otherwise, a classic histogram is rendered.

Signed-off-by: beorn7 <[email protected]>
@beorn7 beorn7 requested a review from jan--f July 10, 2024 20:13
Copy link
Contributor

@jan--f jan--f left a comment

Choose a reason for hiding this comment

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

Thanks!
I think I did the same in pushgateway, so I'll push a PR with the same logic.

@jan--f jan--f merged commit db513a9 into master Jul 11, 2024
5 checks passed
@jan--f jan--f deleted the beorn7/histogram branch July 11, 2024 08:36
@beorn7
Copy link
Member Author

beorn7 commented Jul 11, 2024

In PGW, we are rendering both types of buckets in case both exist, so that should be fine.

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