Skip to content

fix(mappers): preserve embedded CloudWatch span events - #522

Merged
liramon2 merged 1 commit into
strands-agents:mainfrom
ikenyal:fix/preserve-cloudwatch-span-events
Nov 16, 2026
Merged

liramon2 merged 1 commit into
strands-agents:mainfrom
ikenyal:fix/preserve-cloudwatch-span-events

Conversation

@ikenyal

@ikenyal ikenyal commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Description

CloudWatchLogsParser recognizes already-normalized spans, but its event-association step replaces their span_events with separately logged events (or an empty list). This silently drops events that were already attached to the span.

Preserve the embedded events and append any separately logged events to a new list. This also avoids mutating the input records and preserves the current handling of missing, empty, or None event lists.

Related Issues

None. This is a small bug fix found while checking the parser's documented normalized-span support.

Documentation PR

Not needed: this restores the existing documented behavior and adds no API or configuration.

Type of Change

Bug fix

Testing

  • I ran hatch run prepare
  • Formatting, lint, and type checks passed; the full unit suite passed on Python 3.10, 3.11, 3.12, 3.13, and 3.14 (2,541 tests per version).
  • The parser suite passed all 28 tests. Six added cases cover populated, empty, and None embedded event lists, with and without separate events, and verify that input records remain unchanged. The two data-loss cases failed before the fix.
  • Pre-commit formatting, lint, unit-test, and commit-message checks passed.
  • Real-provider integration tests (hatch run test-integ) were not run; they require external providers/model endpoints. The local tests use mocks and do not call AWS or models.
  • The suite still reports existing deprecated-mapper, shared-state, and dependency warnings; this change introduces no warning-producing code or dependency changes.

Checklist

  • I have read the CONTRIBUTING document
  • I have reviewed and understand every line of code in this PR, including any generated by AI tools, and I can explain why it works
  • My change is focused and reasonably small; I have split unrelated work into separate PRs
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly — N/A: existing documented behavior is restored; no documentation change is needed.
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published — N/A: no dependent changes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions github-actions Bot added area-tracing Trace/session ingestion: providers, session mappers, extractors, telemetry/OTEL bug Something isn't working labels Nov 6, 2026
@ikenyal
ikenyal marked this pull request as ready for review November 6, 2026 23:42
@ikenyal
ikenyal requested a review from a team as a code owner November 6, 2026 23:42
@ikenyal
ikenyal requested a review from liramon2 November 6, 2026 23:42
@ikenyal
ikenyal deployed to manual-approval November 16, 2026 14:45 — with GitHub Actions Active
@liramon2
liramon2 merged commit 0084adc into strands-agents:main Nov 16, 2026
23 of 39 checks passed

This branch was successfully deployed

1 active deployment
manual-approval — 21a48fb8 Deployed Nov 16, 2026 by ikenyal via Run integration tests #1116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-tracing Trace/session ingestion: providers, session mappers, extractors, telemetry/OTEL bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants