File tree Expand file tree Collapse file tree
packages/aws-durable-execution-sdk-python-examples/src/otel Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Demonstrates OTel-enriched logging in a durable execution.
22
3- The DurableExecutionOtelPlugin wraps the execution logger (enrich_logger=True
4- by default) so every log line emitted through context.logger / step_context.logger
5- is automatically enriched with the active OpenTelemetry trace context
6- (otel.trace_id, otel.span_id, otel.trace_sampled). This lets logs correlate to
7- the spans the plugin emits without any user code changes.
3+ The DurableExecutionOtelPlugin installs a logging filter on the root logger
4+ (enrich_logger=True by default) when the plugin is constructed. The filter
5+ stamps the active OpenTelemetry trace context (otel_trace_id, otel_span_id,
6+ otel_trace_sampled) onto every log record that flows through the root handler.
7+ This includes logs emitted via context.logger / step_context.logger as well as
8+ direct logging.getLogger() calls and third-party library logs, so logs
9+ correlate to the spans the plugin emits without any user code changes.
810
911Logs emitted:
1012- at the top level correlate to the invocation span
You can’t perform that action at this time.
0 commit comments