[Feature]: OTel plugin: emit severityText and severityNumber on enriched logs
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 67/100
- Issue 類型
- 功能
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
Start with packages/aws-durable-execution-sdk-python-otel/src/aws_durable_execution_sdk_python_otel/log_filter.py, especially OtelContextLogFilter.filter(), and trace how enriched records from the Invocation and Execution plugins reach serialized structured logs. Check existing tests for durable context logs, stdlib logs, and replay behavior. Add coverage for the specified severity mappings and field types across initial and resumed invocations; done means both views emit top-level severity fields while disabled enrichment and default logging remain unchanged.
由索引模型根據 Issue 內容生成。
描述
What would you like?
When aws-durable-execution-sdk-python-otel log enrichment is enabled, include OpenTelemetry severityText and severityNumber on the emitted structured application logs, alongside the existing native log level and trace correlation fields.
This is the Python counterpart of https://github.com/aws/aws-durable-execution-sdk-js/issues/1228.
The current OtelContextLogFilter.filter() adds traceId, spanId, and otelTraceSampled, but does not add either severity field. Both Invocation and Execution OTel plugins use this filter when enrich_logger=True. This finding is based on source inspection of main at 54883810bc417c59017540bae31e35fa9b35bd8c.
OTel-aware consumers, including CloudWatch Logs Analyze logs as described in the JS issue, need the standard severity fields to recognize, filter, and group log severity.
Possible Implementation
Extend the OTel logging enrichment path to set severityText from the source log level and map Python log levels to OpenTelemetry severity numbers:
| Python level | severityText | severityNumber |
|---|---|---|
| DEBUG | DEBUG | 5 |
| INFO | INFO | 9 |
| WARNING | WARNING | 13 |
| ERROR | ERROR | 17 |
| CRITICAL, when logged through stdlib logging | CRITICAL | 21 |
WARNING is Python's spelling of the WARN severity range. logger.exception() should receive ERROR severity, like logger.error().
Follow the OTel log data model. The telemetry exporter's existing severity mapping is based on execution status and cannot be reused directly as an application log-level mapping.
Keep this additive and scoped to active OTel log enrichment. Preserve the existing native level, trace correlation, durable metadata, and replay suppression. Ensure the fields reach the serialized structured log output as top-level fields, with numeric severityNumber, rather than existing only as internal LogRecord attributes.
Acceptance criteria:
- Both Invocation and Execution views emit the fields with the correct types and mappings.
- Cover the durable context logger and stdlib logs that already flow through the enrichment filter.
- Cover an initial invocation and a resumed invocation, preserving suppression of completed durable logs during replay.
- Without the plugin, or with log enrichment disabled, the default logging behavior remains unchanged.
Is this a breaking change?
No.
Does this require an RFC?
No.
Additional Context
- 主要語言
- Python
- 星號
- 59
- 分支
- 32
- 平均合併
- 1 天 5 小時
- 30 天內合併 PR
- 76
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws/aws-durable-execution-sdk-python 的其他 Issue
-
needs-triage
難度 2/5 1-3 小時 新手友好度 82/100
aws/aws-durable-execution-sdk-python#977 ·
維護者通常 1 天內回覆
-
[AgentCore session] Remove the unused session timeout可能已有人在做 @srivilliamsai 今天認領。 未關閉needs-triage
難度 2/5 1-3 小時 新手友好度 77/100
aws/aws-durable-execution-sdk-python#970 · 1 則留言 ·
維護者通常 1 天內回覆
-
enhancement needs-triage
難度 2/5 1-3 小時 新手友好度 72/100
aws/aws-durable-execution-sdk-python#952 ·
維護者通常 1 天內回覆
-
[AgentCore session] W4: Document sessions in the worker README可能已有人在做 @ParidelPooya 於 3 天前認領。 未關閉enhancement needs-triage
難度 1/5 1-3 小時 新手友好度 76/100
aws/aws-durable-execution-sdk-python#950 ·
維護者通常 1 天內回覆
-
[AgentCore session] W3: Add the session ID and job count to worker logs可能已有人在做 @ParidelPooya 於 3 天前認領。 未關閉enhancement needs-triage
難度 2/5 1-3 小時 新手友好度 68/100
aws/aws-durable-execution-sdk-python#949 ·
維護者通常 1 天內回覆
查看 aws/aws-durable-execution-sdk-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 73/100
維護者通常 1 天內回覆
-
Unused loot bag group names left in dreamcraft en_US.lang可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉Status: Triage Suggestion
難度 1/5 1 小時以內 新手友好度 90/100
GTNewHorizons/GT-New-Horizons-Modpack#27789 ·
維護者通常 1 天內回覆
-
bug frontend sev-5
難度 2/5 1-3 小時 新手友好度 83/100
-
core good first issue
難度 2/5 1-3 小時 新手友好度 65/100
-
b4b code health next
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆