You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py
+24-4Lines changed: 24 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -16,12 +16,13 @@
16
16
17
17
"""
18
18
The OpenTelemetry `logging` integration automatically injects tracing context into
19
-
log statements.
19
+
log statements, though it is opt-in and must be enabled explicitly by setting the
20
+
environment variable `OTEL_PYTHON_LOG_CORRELATION` to `true`.
20
21
21
-
Usage
22
-
-----
23
22
.. code-block:: python
24
23
24
+
# export OTEL_PYTHON_LOG_CORRELATION=true
25
+
25
26
import logging
26
27
27
28
from opentelemetry.instrumentation.logging import LoggingInstrumentor
@@ -32,8 +33,27 @@
32
33
33
34
When running the above example you will see the following output:
0 commit comments