-
Notifications
You must be signed in to change notification settings - Fork 889
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
Clarify configuring aggregations with MetricExporter #2746
Comments
IMO it is better to burden vendors with duplicating this method than to burden users with having to understand which temporalities their vendor supports for each instrument type and how to configure them |
@rbailey7210 would you mind expanding on what information I can help to elaborate to triage this issue? thank you <3 |
Agree with @dyladan. Temporality selection is a pretty essential decision for exporters / backends, and not a question that an exporter should side step. In java, while these methods are implementable by MetricReaders, PeriodicMetricReader (i.e. the main MetricReader implementation) simply delegates to its configured MetricExporter, so they're really only configured in one place. |
Can one of @open-telemetry/specs-metrics-approvers take the assignment of this? I don't know much about this topic. |
FWIW, the Go SDK has switched its approach currently. It configures the temporality and aggreation default selectors with options passed to readers on their creation: Though, there is a proposal to change back to having exporters implement methods that set this configuration value: open-telemetry/opentelemetry-go#3260 |
It was suggested here that this should be considered a language implementation choice. I think the way the specification is currently defined it is ambiguous enough that both interpretations are currently allowed. Therefore, it looks like it could technically be considered this. However, the question that I think needs to be resolved is if different languages implement this differently, will OpenTelemetry users be impacted? Will they not be able to achieve the same functionality in one language implementation as the other? It seems to me that if a user of one language implementation uses an exporter that has a preference for temporality/aggregations that differ from the defaults and are able to setup their SDK by just registering it with a reader and they move to another language implementation that requires them to know they also need to configure different temporality/aggregations with a reader that they register a similar exporter with they are going to be frustrated. Both by the fact that things are not working, but also by the fact that OTel is different enough that when they do effectively the same thing in one language as they did in another things don't work. Based on this, I think this falls under the purpose of the specification. It needs to be defined so OpenTelemetry provides users with a consistent and hassle free usage. Furthermore, when a configuration file format is defined, how will it be defined regarding default aggregators/temporality? If all implementations define this with an exporter it would be different than if all implementations define this with a reader. If there is a mismatch, configuration file formats would not be compatible language-to-language. |
Looking at the fact that multiple language implementations have made stable releases (.NET, Java, Python) and they are not all consistent with regard to this, it is likely not possible to uniformly update the specification with one normative statement of how these parameters should be set. That or we will need to update the specification and have non-conforming implementations deprecate their old approach. |
When .NET, Java and Python went GA was there a similar process as when languages went GA with tracing? That is to say, if they were reviewed by separate people who signed off on different interpretations it is a pretty clear sign that the spec is not clear :) |
I've called this question a debate about an implementation detail. @MrAlias wrote:
@tsloughter wrote:
Although it is not clear, when I wrote the specification I meant to allow both interpretations. It was intentional ambiguity, at least. I do recognize there is a problem, given this debate, but I'm not sure whether the better solution is to (a) clearly state that both approaches are OK, (b) try to somehow remove one of the options, or (c) see below. @MrAlias makes two suggestions:
Although I'm starting to sympathize with the first of these points, it makes me wonder whether users of the DotNet and Python SDKs have actually experienced this frustration. Are they frustrated that it is difficult to pair the exporter and its reader settings? For the second of these points, I would not expect the configuration structure to exactly match SDK setup in any language. I'm familiar with the OTel Collector's configuration mechanism and how its factories produce exporters using an This pattern suggests a user-friendly solution to the intentional ambiguity described above. Let each exporter package provide a factory for its class of exporters that, given a list of common Reader options will return the necessary MetricReader, properly configured. Exporters would be expected to configure their intended temporality and default aggregations via their Factory; the actual Exporter would not be required to support an interface to report preferred temporality like the one Java does. |
What are you trying to achieve?
The spec currently defines that:
Currently, SDKs take their own interpretation on this:
MetricExporters have no involvement in determining the aggregation:
MetricExporters have a method to select aggregation for instruments:
This is a bit ambiguous on what MetricExporter's role is in configuring the aggregation with MetricReader. Should MetricReader ask a MetricExporter for the aggregation if MetricReader's optional aggregation selector function is absent?
From reading the spec, default aggregation should be used when the optional aggregation selector is not configured for the MetricReader. There are no words mentioned if a MetricExporter should be involved in the aggregation selection.
Additional context.
We have received complaints about too many "unrelated" methods that need to be implemented on a MetricExporter, like a temporality selector, as it should already be configured with MetricReaders, it can be burdensome for vendors to duplicate the works. (see open-telemetry/opentelemetry-js#3060 (comment)).
@jsuereth mentioned an ordering of selecting an aggregation at #2643 (comment) that gives another interpretation of the spec. Maybe @jsuereth can also chime in here? Also, I'd believe @jmacd has an opinion on this.
Refs: open-telemetry/opentelemetry-js#3153 (comment)
The text was updated successfully, but these errors were encountered: