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
@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

@github-actions github-actions Bot added the Stale label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Document log record enrichment behavior of logging instrumentation

1 participant