Skip to content

feat: add durable_function_execution_status tag to aws.lambda span#751

Draft
jchrostek-dd wants to merge 1 commit intomainfrom
john/de-status
Draft

feat: add durable_function_execution_status tag to aws.lambda span#751
jchrostek-dd wants to merge 1 commit intomainfrom
john/de-status

Conversation

@jchrostek-dd
Copy link
Contributor

Summary

Adds a new tag durable_function_execution_status to the aws.lambda span when using AWS Lambda Durable Execution SDK.

  • SUCCEEDED: Execution completed successfully
  • FAILED: Execution failed
  • PENDING: Execution is still in progress

The tag is only added when the Lambda is invoked as a durable function (event contains DurableExecutionArn) and the response contains a valid Status field.

Changes

  • datadog_lambda/durable.py: Added extract_durable_function_status_tag() function
  • datadog_lambda/wrapper.py: Integrated status extraction in _after() method
  • tests/test_durable.py: Added 10 unit tests for the new functionality

Test Plan

  • Unit tests pass (23/23 tests in test_durable.py)
  • Manual verification with deployed durable Lambda function
  • Integration tests created in datadog-lambda-extension (separate PR)

🤖 Generated with Claude Code

When using AWS Lambda Durable Execution SDK, extract the execution status
from the handler response and add it as a tag to the aws.lambda span.

The tag captures the Status field from durable function responses:
- SUCCEEDED: Execution completed successfully
- FAILED: Execution failed
- PENDING: Execution is still in progress

The tag is only added when:
1. The event contains a DurableExecutionArn (indicates durable invocation)
2. The response is a dict with a valid Status field

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant