Skip to content

Commit

Permalink
Disabling the OTEL exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
dpb-bah committed Dec 9, 2024
1 parent 98c06a0 commit a507f4d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dataactcore/broker_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,16 @@ def configure_logging(service_name='broker'):
# if local, print the traces to the console
trace.get_tracer_provider().add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))
else:
# TODO: Uncomment below to re-activate the OTEL exporter
pass

# Set up the OTLP exporter
# Check out https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
# for more exporter configuration
otel_endpoint = os.getenv("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
if otel_endpoint:
exporter = OTLPSpanExporter(endpoint=otel_endpoint)
trace.get_tracer_provider().add_span_processor(SimpleSpanProcessor(exporter))
# otel_endpoint = os.getenv("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
# if otel_endpoint:
# exporter = OTLPSpanExporter(endpoint=otel_endpoint)
# trace.get_tracer_provider().add_span_processor(SimpleSpanProcessor(exporter))

LoggingInstrumentor(logging_format="%(asctime)s %(levelname)s:%(name)s:%(message)s")
LoggingInstrumentor().instrument(tracer_provider=trace.get_tracer_provider(), set_logging_format=False)
Expand Down

0 comments on commit a507f4d

Please sign in to comment.