Skip to content

Add exponential histogram one-liner print #13379

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cswpy
Copy link

@cswpy cswpy commented Jul 12, 2025

Description

This PR fixes #10463 by adding a one-liner debug printer support for exponential bucket. It also adds unit tests for the printing.

Link to tracking issue

Fixes #10463

Testing

Added test in metrics_test.go.
Passes all tests locally

Documentation

@cswpy cswpy requested review from andrzej-stencel and a team as code owners July 12, 2025 02:17
@cswpy cswpy requested a review from songy23 July 12, 2025 02:17
Copy link

linux-foundation-easycla bot commented Jul 12, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions github-actions bot added the exporter/debug Issues related to the Debug exporter label Jul 12, 2025
Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Could you add a changelog?

dataPoint.Positive().BucketCounts().FromRaw([]uint64{40, 50, 60})
return metrics
}(),
expected: `http.server.request.duration{http.response.status_code=200,http.request.method=GET} count=1340 sum=99.573 min=0.017 max=8.13 le0.8408964152537146=10 le0.9170040432046712=20 le1.0905077326652577=40 le1.189207115002721=50 le1.2968395546510096=60
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't negative bucket boundaries be lower than 0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/debug Issues related to the Debug exporter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[exporter/debug] output buckets for exponential histograms
3 participants