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. |
|
|
||
| @Override | ||
| public DoubleCounterAdviceConfigurer setAttributes(List<AttributeKey<?>> attributes) { | ||
| public ExtendedDoubleCounterBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) { |
There was a problem hiding this comment.
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.
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.
jkwatson
left a comment
There was a problem hiding this comment.
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.