opentelemetry-dotnet-instrumentation icon indicating copy to clipboard operation
opentelemetry-dotnet-instrumentation copied to clipboard

Document OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE environment variable

Open pichlermarc opened this issue 3 years ago • 9 comments

Feature Request

Is your feature request related to a problem? Please describe. Currently the OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE enviornment variable is not used to configure the export temporality (see here).

The spec states that:

If a language provides a mechanism to automatically configure a MetricReader to pair with the associated Exporter (e.g., using the OTEL_METRICS_EXPORTER environment variable), then by default:

  • The exporter MUST be paired with a periodic exporting MetricReader.
  • The exporter MUST configure the default aggregation temporality on the basis of instrument kind using the OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE variable as described below.
  • The exporter MUST configure the default aggregation on the basis of instrument kind using the OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION variable as described below if it is implemented.

Describe the solution you'd like Allow configuration of aggregation temporality via OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE

Additional context As this is a MUST requirement in the spec, this might also be a bug.

pichlermarc avatar Oct 11 '22 13:10 pichlermarc

Thanks for reporting the issue. I created a similar one in the OTel .NET SDK: https://github.com/open-telemetry/opentelemetry-dotnet/issues/3756

pellared avatar Oct 12 '22 05:10 pellared

Hi, @pellared thanks for creating the issue in the core repo. :slightly_smiling_face:

I was not sure if here is the right place, or if I should open it in the core repo, but as the condition part of this spec

If a language provides a mechanism to automatically configure a MetricReader to pair with the associated Exporter (e.g., using the OTEL_METRICS_EXPORTER environment variable), then by default

is implemented in this repo, I opted to open the issue here instead. :slightly_smiling_face:

If there's a consensus where this feature belongs then I can also dedicate some time to implement this if necessary. :slightly_smiling_face:

pichlermarc avatar Oct 12 '22 05:10 pichlermarc

@pichlermarc, we have a plan release 0.4.0-beta shortly. If it is important feature for you we can include it into this code base. If it can wait it should be implemented in the api/sdk repository.

Upgrade path for OTel API/SDK 1.4.0 will be more complicated and it will take more time.

If there's a consensus where this feature belongs then I can also dedicate some time to implement this if necessary. 🙂

Sounds great!

Kielek avatar Oct 12 '22 06:10 Kielek

If there's a consensus where this feature belongs then I can also dedicate some time to implement this if necessary. 🙂

It is fine to implement it here before it is supported via the SDK 👍 We are open to your contribution 🎉

pellared avatar Oct 12 '22 07:10 pellared

@pichlermarc Are you working on it? Do you need any help?

pellared avatar Oct 27 '22 13:10 pellared

@pellared, sorry, I did not get around to doing this yet. :/ I'll comment here when I get to working on it.

pichlermarc avatar Nov 04 '22 07:11 pichlermarc

This PR adds a workaround for a moment missing direct configuration option. https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/1542

RassK avatar Nov 09 '22 11:11 RassK

Hi, I just went over old issues I created and this seems to be already implemented.

I just tried this out using the automatic instrumentation docs on opentelemetry.io, switched the exporter to OTLP and set up the environment variable.

Big thanks to the person who took care of that :slightly_smiling_face:

pichlermarc avatar Feb 07 '24 12:02 pichlermarc

Reopening as the environment variable is not documented.

pellared avatar Feb 07 '24 13:02 pellared