Skip to content

Commit f11eedc

Browse files
xrmxpmcollins
andauthored
Apply suggestions from code review
Co-authored-by: Pablo Collins <pabcolli@cisco.com>
1 parent dcc105f commit f11eedc

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

  • instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging

instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def record_factory(*args, **kwargs):
229229
"you don't need to set `OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true`"
230230
)
231231
elif kwargs.get(
232-
"enable_log_auto_istrumentation",
232+
"enable_log_auto_instrumentation",
233233
environ.get(OTEL_PYTHON_LOG_AUTO_INSTRUMENTATION, "true")
234234
.strip()
235235
.lower()

instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/constants.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717

1818
_MODULE_DOC = """
1919
The OpenTelemetry ``logging`` instrumentation automatically instruments Python logging
20-
system with an handler to convert log messages into OpenTelemetry logs.
21-
You can disable this setting ``OTEL_PYTHON_LOG_AUTO_INSTRUMENTATION`` to ``false``.
20+
with a handler to convert Python log messages into OpenTelemetry logs and export them.
21+
You can disable this by setting ``OTEL_PYTHON_LOG_AUTO_INSTRUMENTATION`` to ``false``.
2222
2323
.. warning::
2424
25-
The code in this instrumentation is based from code available in the ``opentelemetry-sdk`` that is now deprecated.
26-
Therefore if you have opentelemetry-instrumentation-logging installed you don't need to set
25+
This package provides a logging handler to replace the deprecated one in ``opentelemetry-sdk``.
26+
Therefore if you have ``opentelemetry-instrumentation-logging`` installed, you don't need to set the
2727
``OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED`` environment variable to ``true``.
28-
This instrumentation does not add by the default ``code`` namespace attributes, can be added back using the
29-
``OTEL_PYTHON_CODE_ATTRIBUTES`` environment variable.
28+
By default, this instrumentation does not add ``code`` namespace attributes as the SDK's logger does, but adding them can be enabled by using the
29+
``OTEL_PYTHON_LOG_CODE_ATTRIBUTES`` environment variable.
3030
3131
Enable trace context injection
3232
------------------------------
@@ -59,14 +59,13 @@
5959
6060
.. envvar:: OTEL_PYTHON_LOG_AUTO_INSTRUMENTATION
6161
62-
This env var must be set to ``false`` in order to disable automatic instrumentation of the Python logging module with a handler
63-
that will convert log message into OpenTelemetry logs.
62+
Set this env var to ``false`` to skip installing the logging handler provided by this package.
6463
6564
The default value is ``true``.
6665
6766
.. envvar:: OTEL_PYTHON_CODE_ATTRIBUTES
6867
69-
This env var can be used to fill ``code`` attributes into OpenTelemetry logs referencing the Python code that is emitting log messages.
68+
Set this env var to ``true`` to add ``code`` attributes (``code.file.path``, ``code.function.name``, ``code.line.number``) to OpenTelemetry logs, referencing the Python source location that emitted each log message.
7069
7170
The default value is ``false``.
7271

0 commit comments

Comments
 (0)