opentelemetry-specification icon indicating copy to clipboard operation
opentelemetry-specification copied to clipboard

Handling "none" value in OTEL_PROPAGATORS, OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER and OTEL_LOGS_EXPORTER

Open robsunday opened this issue 2 months ago • 6 comments

What are you trying to achieve? I need to understand how SDK is supposed to behave if value "none" is specified together with other value(s) in any of the following environment variables:

  • OTEL_PROPAGATORS
  • OTEL_TRACES_EXPORTER
  • OTEL_METRICS_EXPORTER
  • OTEL_LOGS_EXPORTER

Additional context.

sdk-environment-variables.md file metions that value "none" indicates that no propagator or appropriate exporter should be configured. The issue is that these environment variables can hold a list of values. In current specification I did not find any information what should happen if for example OTEL_PROPAGATORS has value "baggage, none". I think such a specification would be worth adding.

In this case Java SDK throws an exception (see PropagatorConfiguration.java), but is it the right approach?

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

robsunday avatar Oct 08 '25 13:10 robsunday

In this case Java SDK throws an exception (see PropagatorConfiguration.java), but is it the right approach?

I don’t think that’s the right approach. "none" should represent a no-op configuration instead of causing an error.

pellared avatar Oct 13 '25 05:10 pellared

So to be clear - do you suggest that all propagators should be silently skipped if "none" is specified as one of the items in the propagator list ?

robsunday avatar Oct 13 '25 07:10 robsunday

It is good that you are asking. For OTEL_PROPAGATORS=baggage,none the W3C Baggage Propagator is set. The none acts as a "NullValue".

pellared avatar Oct 13 '25 08:10 pellared

It is good that you are asking. For OTEL_PROPAGATORS=baggage,none the W3C Baggage Propagator is set. The none acts as a "NullValue".

Java considers this an error because it doesn't make any sense, and probably means that the user has made a mistake in their env var setting.

jkwatson avatar Oct 13 '25 15:10 jkwatson

I would tend to agree with the reasoning that having "none" among other propagators doesn't make sense and looks like a config mistake.

dmathieu avatar Oct 13 '25 16:10 dmathieu

@robsunday, can you check how different languages are handling this already?

pellared avatar Oct 27 '25 08:10 pellared