[SVLS-8583] Add execution_status tag to aws.lambda span for durable functions#764
Merged
[SVLS-8583] Add execution_status tag to aws.lambda span for durable functions#764
Conversation
…able functions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds durable-function execution status tagging to the aws.lambda span so downstream trace analysis can distinguish outcomes of durable function invocations.
Changes:
- Add
aws_lambda.durable_function.execution_statustag extraction based onresult.Statusfor durable events. - Introduce
extractDurableExecutionStatushelper with validation of allowed status values. - Add unit tests for
extractDurableExecutionStatus.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/trace/listener.ts | Sets the new durable execution status tag on the active aws.lambda span during invocation teardown. |
| src/trace/durable-function-context.ts | Adds validated extraction of durable execution status from handler result. |
| src/trace/durable-function-context.spec.ts | Adds test coverage for the new status-extraction helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…Status enum Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use typeof string guard in extractDurableExecutionStatus for consistency - Move execution_status tagging outside durableFunctionContext block so it applies even when ARN parsing fails - Add listener.spec.ts tests for execution_status tag being set and not set Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
litianningdatadog
approved these changes
Apr 15, 2026
Contributor
litianningdatadog
left a comment
There was a problem hiding this comment.
Stamped. Please watch out the e2e failure
Contributor
Author
|
E2E test deployment keeps failing with error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aws_lambda.durable_function.execution_statustag to theaws.lambdaspan for durable function invocationsresult.Statusin the handler response; valid values areSUCCEEDED,FAILED,PENDING(matching theInvocationStatusenum in the durable execution SDK)DurableExecutionArn, independent of whether ARN parsing succeedsAutomated testing
extractDurableExecutionStatusindurable-function-context.spec.tscovering all valid statuses, invalid status, missing status, null result, and non-durable eventslistener.spec.tsto verify the status tag is set whenresult.Statusis valid and not set otherwiseManual testing
Tested with a durable function which has 2 invocations in an execution.
The
aws.lambdaspan for the 1st invocation has tagexecution_status:PENDING(link)For the 2nd invocation, the tag is
execution_status:FAILED(link) orexecution_status:SUCCEEDED(link)Note
Before an execution finishes (either fails or succeeds), the status is shown as RUNNING, even if the execution is paused. I'm planning to do the same on our UI, so the
PENDINGstatus won't be used, but still adding it as a tag because it's also informative as a tag itself.Next steps
🤖 Generated with Claude Code