fix: every log line is exported twice to the OpenTelemetry collector when traces and logs are both on (#31528)

With ENABLE_OTEL, ENABLE_OTEL_TRACES and ENABLE_OTEL_LOGS all on, the collector received each log line twice, once with code location attributes and once without, because the logging instrumentation for traces now attaches its own log exporter next to Open WebUI's. It now keeps trace context on log lines without adding that second exporter, so each log line reaches the collector once, and OTEL_PYTHON_LOG_AUTO_INSTRUMENTATION=false is no longer needed as a workaround.

Fixes #31524
This commit is contained in:
Classic298 2026-09-30 17:36:43 +02:00 • committed by GitHub
parent 2f6addf351
commit bff0492b5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -178,7 +178,7 @@ class Instrumentor(BaseInstrumentor):
SQLAlchemyInstrumentor().instrument(engine=self.db_engine)
RedisInstrumentor().instrument(request_hook=redis_request_hook)
RequestsInstrumentor().instrument(request_hook=requests_hook, response_hook=response_hook)
LoggingInstrumentor().instrument()
LoggingInstrumentor().instrument(enable_log_auto_instrumentation=False)
HTTPXClientInstrumentor().instrument(
request_hook=httpx_request_hook,
response_hook=httpx_response_hook,