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

Use WithExplicitBucketBoundaries in the prometheus example #4686

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented Nov 1, 2023

Users no longer need to use views to match the behavior of prometheus.NewHistogramVec.

Tested by manually verifying the prometheus output:

# HELP baz a histogram with custom buckets and rename
# TYPE baz histogram
baz_bucket{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version="",le="64"} 1
baz_bucket{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version="",le="128"} 1
baz_bucket{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version="",le="256"} 2
baz_bucket{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version="",le="512"} 2
baz_bucket{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version="",le="1024"} 4
baz_bucket{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version="",le="2048"} 4
baz_bucket{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version="",le="4096"} 4
baz_bucket{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version="",le="+Inf"} 4
baz_sum{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version=""} 1731
baz_count{A="B",C="D",otel_scope_name="github.com/open-telemetry/opentelemetry-go/example/prometheus",otel_scope_version=""} 4

This is a minor cleanup in an example, so skipping changelog

@dashpole dashpole added pkg:example Related to an example Skip Changelog PRs that do not require a CHANGELOG.md entry labels Nov 1, 2023
@dashpole dashpole force-pushed the update_prom_example branch from 3c15348 to 6a9382b Compare November 2, 2023 00:46
@pellared pellared merged commit e3d0c50 into open-telemetry:main Nov 2, 2023
24 checks passed
@XSAM XSAM added this to the Old Untracked PRs milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:example Related to an example Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants