Skip to content
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 reader / exporter relationship for temporality preference and default aggregation #4142

Merged

Conversation

jack-berg
Copy link
Member

Reviewing @dashpole's comments on #4124, I realize that a key clarification is missing for the contract between readers and exporters, and for the configuration of built-in exporters.

We state that MetricReaders should be constructed with:

  • "The default output aggregation (optional), a function of instrument kind. If not configured, the default aggregation SHOULD be used."
  • "The default output temporality (optional), a function of instrument kind. If not configured, the Cumulative temporality SHOULD be used."

And for MetricExporters, we state that "The aggregation and temporality properties used by the OpenTelemetry Metric SDK are determined when registering Metric Exporters through their associated MetricReader."

But we don't connect the dots that the aggregation and temporality options for the MetricReader should be obtained from a MetricExporter. I think this is understood, since the whole reason these are configurable at the MetricReader level is that MetricExporters and their associated backends have different requirements around temporality and default aggregation (especially in the case of base2 exponential histogram).

This PR clarifies that the MetricReader aggregation and temporality options SHOULD come from the associated MetricExporter, NOT from the caller.

Furthermore, because these are now clearly spelled out as preferences of MetricExporter, I've updated all the built-in metric exporter definitions to make expectations clear around what defaults and configuration of aggregation and temporality should be supported. This achieves the goals of #4124 in a more generic way.

Exporter default aggregation temporality
Prometheus configurable always cumulative
OTLP configurable configurable
Standard Output configurable configurable
InMemory configurable configurable

@jack-berg jack-berg changed the title Clarify that reader / exporter relationship for temporality and aggre… Clarify reader / exporter relationship for temporality and aggregation preference Jul 15, 2024
@jack-berg jack-berg changed the title Clarify reader / exporter relationship for temporality and aggregation preference Clarify reader / exporter relationship for temporality preference and default aggregation Jul 15, 2024
@jack-berg
Copy link
Member Author

Will merge wednesday 7/24 if there are no additional comments.

jack-berg added a commit that referenced this pull request Jul 23, 2024
Splitting off a portion of #4142. This PR makes the host and port
configuration options explicit for the prometheus exporter. Currently,
they're [implied from the corresponding env
vars](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#prometheus-exporter)
`OTEL_EXPORTER_PROMETHEUS_HOST` and `OTEL_EXPORTER_PROMETHEUS_PORT`.

See this
[convo](https://github.com/open-telemetry/opentelemetry-specification/pull/4142/files#r1674675871)
for more details.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
@jack-berg jack-berg merged commit 2903e64 into open-telemetry:main Jul 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants