[Feature]: OTel plugin: emit severityText and severityNumber on enriched logs
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 67/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- observability
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 59
- Forks
- 32
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 76
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/aws-durable-execution-sdk-python
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aws/aws-durable-execution-sdk-python#977 ·
Los mantenedores suelen responder en 1 día
-
[AgentCore session] Remove the unused session timeoutPosiblemente ocupada @srivilliamsai la tomó hoy. Abiertoneeds-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
aws/aws-durable-execution-sdk-python#970 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws/aws-durable-execution-sdk-python#952 ·
Los mantenedores suelen responder en 1 día
-
[AgentCore session] W4: Document sessions in the worker READMEPosiblemente ocupada @ParidelPooya la tomó hace 3 días. Abiertoenhancement needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 76/100
aws/aws-durable-execution-sdk-python#950 ·
Los mantenedores suelen responder en 1 día
-
[AgentCore session] W3: Add the session ID and job count to worker logsPosiblemente ocupada @ParidelPooya la tomó hace 3 días. Abiertoenhancement needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
aws/aws-durable-execution-sdk-python#949 ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws/aws-durable-execution-sdk-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
Unused loot bag group names left in dreamcraft en_US.langPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. AbiertoStatus: Triage Suggestion
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
GTNewHorizons/GT-New-Horizons-Modpack#27789 ·
Los mantenedores suelen responder en 1 día
-
bug frontend sev-5
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
-
core good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
b4b code health next
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ESCOMP/CTSM#4330 · 1 comentario ·
Los mantenedores suelen responder en 1 día