-
Notifications
You must be signed in to change notification settings - Fork 843
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
Refactor advice API #5848
Refactor advice API #5848
Conversation
the second one looks simpler, so 👍🤷♂️ (but no really strong feelings) one thing that's nice about the single |
Yeah I'm kind of a partial to the API proposed here. Another reason to go with separate methods is that the pattern of passing in a consumer to configure parameters may not be intuitive for every user. |
ya, I've noticed confusion about the autoconfiguration builder which uses this pattern |
@open-telemetry/java-approvers PTAL. Would like to get this in for the next release so we can stabilize the API in the following. Or, potentially stabilize in the next release with this updated API. |
@@ -109,7 +101,7 @@ public ObservableDoubleMeasurement buildObserver() { | |||
} | |||
|
|||
@Override | |||
public DoubleCounterAdviceConfigurer setAttributes(List<AttributeKey<?>> attributes) { | |||
public ExtendedDoubleCounterBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we return this external interface without causing trouble for people using this class without the incubator code present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The incubator code is always present on the classpath. Its just an implementation dependency instead of api, so users have to add it as a dependency of their own to access the extended behavior. Including the incubator as a implementation dependency is acceptable because its not part of the public API of the SDK, and it doesn't include any transitive dependencies that would make it questionable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me. one question about returning an interface from another, optional module.
The explicit bucket boundaries advice API is now stable: open-telemetry/opentelemetry-specification#3694
Before it stabilized, there was a change made to adjust advice from encapsulating 1 or more parameters to being a class / category of parameter. The idea was to be able to offer simplified ergonomics to users:
Would like to try to get our explicit bucket boundary stable, but first want to explore this as an option and collect feedback.