@@ -9,6 +9,7 @@ import static datadog.trace.api.config.GeneralConfig.RUNTIME_METRICS_ENABLED
99import static datadog.trace.api.config.GeneralConfig.SERVICE_NAME
1010import static datadog.trace.api.config.GeneralConfig.TAGS
1111import static datadog.trace.api.config.GeneralConfig.VERSION
12+ import static datadog.trace.api.config.OtlpConfig.OTLP_TRACES_EXPORTER
1213import static datadog.trace.api.config.TraceInstrumentationConfig.TRACE_ENABLED
1314import static datadog.trace.api.config.TraceInstrumentationConfig.TRACE_EXTENSIONS_PATH
1415import static datadog.trace.api.config.TraceInstrumentationConfig.TRACE_OTEL_ENABLED
@@ -231,6 +232,46 @@ class OtelEnvironmentConfigSourceTest extends DDSpecification {
231232 source. get(TRACE_EXTENSIONS_PATH ) == ' /opt/opentelemetry/extensions'
232233 }
233234
235+ // TODO: Do we expect to support the system property version of this, actually?
236+ def " otel traces exporter otlp system property is mapped" () {
237+ setup :
238+ injectSysConfig(' dd.trace.otel.enabled' , ' true' , false )
239+ injectSysConfig(' otel.traces.exporter' , ' otlp' , false )
240+
241+ when :
242+ def source = new OtelEnvironmentConfigSource ()
243+
244+ then :
245+ source. get(TRACE_ENABLED ) == null
246+ source. get(OTLP_TRACES_EXPORTER ) == ' otlp'
247+ }
248+
249+ def " otel traces exporter otlp environment variable is mapped" () {
250+ setup :
251+ injectEnvConfig(' DD_TRACE_OTEL_ENABLED' , ' true' , false )
252+ injectEnvConfig(' OTEL_TRACES_EXPORTER' , ' otlp' , false )
253+
254+ when :
255+ def source = new OtelEnvironmentConfigSource ()
256+
257+ then :
258+ source. get(TRACE_ENABLED ) == null
259+ source. get(OTLP_TRACES_EXPORTER ) == ' otlp'
260+ }
261+
262+ def " otel traces exporter none still disables tracing" () {
263+ setup :
264+ injectEnvConfig(' DD_TRACE_OTEL_ENABLED' , ' true' , false )
265+ injectEnvConfig(' OTEL_TRACES_EXPORTER' , ' none' , false )
266+
267+ when :
268+ def source = new OtelEnvironmentConfigSource ()
269+
270+ then :
271+ source. get(TRACE_ENABLED ) == ' false'
272+ source. get(OTLP_TRACES_EXPORTER ) == null
273+ }
274+
234275 def " otel resource attributes system property is mapped" () {
235276 setup :
236277 injectSysConfig(' dd.trace.otel.enabled' , ' true' , false )
0 commit comments