How can I enable custom exporter via OTEL_TRACES_EXPORTER environment variable

161 views Asked by At

I intend to implement a custom span exporter in open-telemetry-java SDK, for this purpose I have written a class extending interface SpanExporter.

I am running an instrumented Java application which is auto-instrumented using open-telemetry-java SDK instrumentation library jar, I am able to build my custom jar with my custom SpanExporter and successfully run it. I attach my SpanExporter to TraceSDK using AutoConfigurationCustomizerProvider, but I do not want to hardcode it and set it directly via the environment variable OTEL_TRACES_EXPORTER. How can this be achieved?

1

There are 1 answers

0
Gregor Zeitlinger On

You have different choices - I wasn't sure which one you're looking for: