-
Notifications
You must be signed in to change notification settings - Fork 906
Bring metrics exemplar filter and reservoir out of internal
#7636
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7636 +/- ##
=========================================
Coverage 90.01% 90.01%
- Complexity 7090 7091 +1
=========================================
Files 803 803
Lines 21443 21443
Branches 2092 2092
=========================================
Hits 19301 19301
Misses 1477 1477
Partials 665 665 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public interface ExemplarReservoir<T extends ExemplarData> { |
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.
Does this guy need to be part of our public API? Do we want to allow people to create their own custom reservoir implementations? Just making sure we're not opening things up a bit too much before we know this is something that we want people to be able to customize.
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.
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.
cool. thanks for checking. 👍🏽
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.
Thanks! I'd like @jack-berg to verify this API is good to go, then we should be good to merge.
5bc1732
to
44887f9
Compare
Declarative config is missing - not sure if if was forgotten before - but we should add it now:
|
@zeitlinger sorry I'm not following. What does that have to do with this change? |
just noticed that while reviewing the change - declarative config support can only be added with this change, because it makes the builder method public - or we do a follow-up PR |
Ah ok. Well I'd prefer a follow-up PR if that's ok with you. |
Created #7667 |
+++ NEW INTERFACE: io.opentelemetry.sdk.metrics.exemplar.ExemplarFilter | ||
+++ NEW SUPERCLASS: java.lang.Object | ||
+++ NEW METHOD: PUBLIC(+) boolean shouldSampleMeasurement(long, io.opentelemetry.api.common.Attributes, io.opentelemetry.context.Context) | ||
+++ NEW METHOD: PUBLIC(+) boolean shouldSampleMeasurement(double, io.opentelemetry.api.common.Attributes, io.opentelemetry.context.Context) |
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.
Some changes were made from the original exemplar design vs. what was ultimately marked stable. Notably, ExemplarFilter is no longer a extension plugin interface. See the difference in language between ExemplarFilter and ExemplarReservoir which is a extension plugin interface:
- ExemplarFilter: "The ExemplarFilter configuration MUST allow users to select between one of the built-in ExemplarFilters."
- ExemplarReservoir: "The ExemplarReservoir interface MUST provide a method to offer measurements to the reservoir and another to collect accumulated Exemplars."
We need to adjust our API for ExemplarFilter accordingly. Its actually conceptually similar to our Aggregation: modeled as an interface with no methods, with the actual meaningful interface / methods in the internal AggregationFactory.
Resolves #7503
Back in 2022 the metrics
ExemplarFilter
(and reservoir) were hidden in aninternal
package (in #4276) while waiting on the spec to stabilize. Now that Exemplars are marked as stable, it should be safe to now bring these out of the "internal" packaging.I left the existing utility method that invoked the package private method using reflection, but marked it as deprecated. Our normal process is to give a release with the deprecation before removing.