open-telemetry / open-telemetry/opentelemetry-python

Logging AutoInstrumentation does not support capturing INFO logs

Open
#3,473 13 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug logging
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Describe your environment
Python 3.10.12

Steps to reproduce

Using the code here, but with a logging.info rather than logging.warning: https://github.com/kuza55/pants_debug_otel/blob/main/src/no_configuration.py

I would expect setting OTEL_PYTHON_LOG_LEVEL=INFO to let me see info logs

What is the expected behavior?

I would expect to use the OTEL_PYTHON_LOG_LEVEL env variable mentioned in the docs to let me see info logs.

What is the actual behavior?

Environment variable has no impact

Additional context

Calling LoggingInstrumentor().instrument(set_logging_format=True, log_level="INFO") can resolve this, but is not compatible with auto-instrumentation, even when the auto-instrumentation env variable is set to false:

$ OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=false opentelemetry-instrument python3 no_configuration.py
Attempting to instrument while already instrumented

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the auto-instrumentation path exercised by opentelemetry-instrument and compare it with LoggingInstrumentor().instrument(set_logging_format=True, log_level="INFO"). Reproduce the behavior using no_configuration.py and OTEL_PYTHON_LOG_LEVEL=INFO; done means INFO logs are captured through auto-instrumentation without triggering the already-instrumented warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.