Skip to content

docs(logging): document log record enrichment#4652

Open
popsiclelmlm wants to merge 1 commit into
open-telemetry:mainfrom
popsiclelmlm:docs/logging-record-enrichment
Open

docs(logging): document log record enrichment#4652
popsiclelmlm wants to merge 1 commit into
open-telemetry:mainfrom
popsiclelmlm:docs/logging-record-enrichment

Conversation

@popsiclelmlm

Copy link
Copy Markdown

Summary

Fixes #2642.

Documents the logging instrumentation behavior in the package README, including:

  • exporting Python log records as OpenTelemetry logs
  • opt-in trace context injection / log correlation
  • injected logging.LogRecord attributes
  • relevant environment variables and matching LoggingInstrumentor().instrument(...) arguments

Reproduction

The logging instrumentation README currently only covers installation and references. It does not explain the log record enrichment behavior requested in #2642.

Root cause

The enrichment and configuration details are implemented in the instrumentation, but the package README did not describe the behavior or fields added to log records.

Changes

  • Added usage guidance for LoggingInstrumentor.
  • Added a trace context injection section listing otelSpanID, otelTraceID, otelServiceName, and otelTraceSampled.
  • Added a configuration section covering the logging-related environment variables and kwargs.
  • Renamed the generated docs reference link text to avoid a duplicate implicit RST target.

Tests

  • git diff --check
  • /tmp/otel-rstcheck-venv/bin/rstcheck instrumentation/opentelemetry-instrumentation-logging/README.rst

Screenshots/Logs

N/A. Documentation-only change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Document log record enrichment behavior of logging instrumentation

1 participant