-
Notifications
You must be signed in to change notification settings - Fork 896
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
Exemplar clarifications #2421
Comments
@jack-berg #2919 has addressed the 1st part, that can be |
Regarding point 2 and 3, this statement from the specification needs to be clarified:
|
That sounds appropriate to me. I could also see in addition to this having views set an override. |
That is indeed confusing given there are only two option and configuring them differently would lead to incorrect behavior.
If we can verify the reservoir definition is mostly stable and extensible in a backwards compatible manner I think allowing users to provide their own would be a big benefit. This space is open to a lot of complex and tailored algorithms that I expect users want to include. |
The scope of the reservoir sampling needs to also be clarified. It is not explicitly stated, but it seems safe to assume an exemplar reservoir is scoped to a single instrument and not the entire SDK. Right? Within the scope of an instrument, is an exemplar reservoir sampling scoped by attributes? For example, if an instrument measures a value with attributes Based on the Java implementation, I think the reservoir scope is all attribute sets across an instrument. However, the OTLP data model makes me wonder if that is correct. Messages like the |
Its a bit hard to see in the source code, but the java SDK does actually create a reservoir for each unique set of attributes. |
Ah, gotcha. So if you have a fixed size exemplar reservoir that samples Is this the behavior we want? I like this strategy because it is easier to implement, but I worry it is going to generate a lot of exemplar data, right? |
Correct.
Depends on the size of N. In java, we choose N to be equal to the number of available processors. This decision isn't specified anywhere, but it was included (I believe by @jsuereth) in the initial exemplar implementation and has stuck. This is typically smaller than the number of exemplars for histograms, which is one per bucket. Not sure what exactly I would expect the default to be. I suppose I would expect each unique set of attributes to typically receive at least on the order of hundreds of measurements for collection period. (Given that the default interval for PMR is 30s, 100 measurements would be >= 3.3 / second.) I think something in the range of 1-10 example measurements seems appropriate. |
Isn't this then multiplied by the number of unique attribute sets though? So if a users is using the random fixed size reservoir with a size of 10, they measure across N unique attribute sets, and they make more than 10 measurements per unique attribute set per collection cycle they will have 10*N exemplars. I could see users asking for a random fixed size reservoir with a size of 10 to expect they will get at most 10 exemplars per collection cycle. |
Yes. 1 seems more appropriate if the number of measurements is around 100-1000. 10 seems more appropriate if the number of measurements is much larger, say 10_000+. Might be good to specify that the default size of the fixed size reservoir is 1. |
Yeah, this kind of cardinality issues was what lead me to ask the original scope question. If we define the sampling scope to be the instrument (across all unique attributes) instead a user will have a better ability to set the output size they want. |
If we want to stick with the sampling scope being "per unique attribute", my next question was if we want to keep passing the attributes to the |
This reservoir type is used for all aggregations other than a histogram with more than one bucket. Each attribute set the aggregation records will have reservoir. Therefore, limiting this to a small value by default when enabled is preferable. This does not address the way a user will configure this value. That is left for a future PR/Issue. Part of open-telemetry#2421
Just commenting on:
For Java at least (and I suspect it may be true in Go), passing the full set of attributes can lead to more optimal overall throughput. Specifically:
|
…n-telemetry#3760) Fixes open-telemetry#2205 Fixes open-telemetry#3674 Fixes open-telemetry#3669 Partially fixes open-telemetry#2421 ## Changes - Update example exemplar algorithm to account for initial reservoir fill - Update fixed-size defaults to account for memory contention / optimization in Java impl - Set a default for exponential histogram aggregation - Clarify that ExemplarFilter should be configured on MeterProvider - Make it clear that ONE reservoir is create PER timeseries datapoint (not one reservoir per view or metric name). - Allow flexibility in Reservoir `offer` definition based on feedback from Go impl. * Related issues open-telemetry#3756 --------- Co-authored-by: David Ashpole <dashpole@google.com> Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Doing a pass on the java exemplar implementation and found some places in the spec that need additional clarification IMO:
More clearly define built-in exemplar filters
The spec says to "See Defaults and Configuration for built-in filters", which eventually leads to a list of
"none"
,"all"
, and"with_sampled_trace"
. These should be defined in the metric SDK document for improved clarify.Define how an ExemplarFilter gets configured in the SDK
The Java SDK currently allows ExemplarFilter to be configured on a meter provider instance, which is presumably the right place, but that isn't explicitly stated anywhere.
Clarify whether views can configure exemplar reservoirs
There's a TODO that states "after we release the initial Stable version of Metrics SDK specification, we will explore how to allow configuring custom ExemplarReservoirs with the View API.", yet the view section specifies that exemplar reservoirs can optionally be specified.
Is the intention that views can be configured with variations of the built-in reservoirs, but custom reservoirs are disallowed for the time being?
Define the default size of
SimpleFixedSizeExemplarReservoir
If exemplars are enabled,
SimpleFixedSizeExemplarReservoir
is used by all aggregations except explicit bucket histogram, yet the default size of the reservoir is left unspecified.The text was updated successfully, but these errors were encountered: