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

feat: Explicit bucket boundary advisory parameter #1703

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

Conversation

kaylareopelle
Copy link
Contributor

@kaylareopelle kaylareopelle commented Aug 28, 2024

The advisory parameter :explicit_bucket_boundaries allows instrumentation authors to set bucket boundaries for histograms that differ from the default bucket set. Since this only applies to histograms, advice is not explicitly assigned in other instruments, so shared methods have an optional argument that defaults to nil.

Any key passed to advice will be accepted, but only the :explicit_bucket_boundaries symbol will have an effect.

Advice is used by instrumentation for metrics configuration, similar to how views are used by users.

Relates to #1686

The advisory parameter explicit_bucket_boundaries allows instrumentation
authors to set bucket boundaries for histograms that differ from the
default bucket set. Since this only applies to histograms, advice
is not explicitly assigned in other instruments, however, shared methods
will have an empty hash assigned as the default argument.

Any key passed to advice will be accepted, but only the
:explicit_bucket_boundaries symbol will have an effect.
The API doesn't have the functionality tested
@@ -8,19 +8,22 @@ module OpenTelemetry
module Internal
# @api private
class ProxyInstrument
def initialize(kind, name, unit, desc, callable)
def initialize(kind, name, unit, desc, callable, advice = nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, advice is shorter than advisory_parameters, so that's why I chose that word. However, it's not the latest terminology used in the spec. I'm happy to change to advisory_parameters if that's preferred. Perhaps some documentation would clarify things.

kaylareopelle and others added 5 commits September 4, 2024 12:29
must_equal(nil) will be removed in Minitest 6
…e/opentelemetry-ruby into metrics-advisory-parameters
Assign the advice instance variable in histograms only.
Advice will default to nil in all cases.
@kaylareopelle kaylareopelle force-pushed the metrics-advisory-parameters branch from a3467ce to bcb1caf Compare September 19, 2024 22:01
Copy link
Contributor

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

2 participants