Skip to content

docs: document log record enrichment behavior of logging instrumentation#4753

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

docs: document log record enrichment behavior of logging instrumentation#4753
krrishapatel wants to merge 1 commit into
open-telemetry:mainfrom
krrishapatel:docs/logging-instrumentation-enrichment

Conversation

@krrishapatel

Copy link
Copy Markdown

Description

Expands the logging instrumentation README to document what the instrumentation actually does — enriching log records with trace context for log correlation.

Fixes #2642

Type of change

  • This change requires a documentation update

What's documented

  • Purpose of the instrumentation (enriches, doesn't replace stdlib logging)
  • Injected attributes: otelTraceID, otelSpanID, otelTraceSampled, otelServiceName
  • Two usage modes: inject_trace_context=True (attributes only) and set_logging_format=True (attributes + format)
  • All 6 environment variables with descriptions
  • The log_hook callback mechanism with example

How Has This Been Tested?

Documentation-only change. Verified RST structure is consistent with other instrumentation READMEs in the repo.

Does This PR Require a Core Repo Change?

  • No.

Assisted-by: Claude Opus 4.6

Expand the logging instrumentation README to explain:
- What the instrumentation does (enriches log records with trace context)
- Which attributes are injected (otelTraceID, otelSpanID, etc.)
- Configuration via environment variables
- The log_hook callback mechanism
- Usage examples for both inject_trace_context and set_logging_format

Assisted-by: Claude Opus 4.6
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