Add durable_function_first_invocation tag to aws.lambda spans#747
Draft
Add durable_function_first_invocation tag to aws.lambda spans#747
Conversation
Introduces a durable_execution() decorator that sets the
durable_function_first_invocation tag ("true"/"false") on the active
span based on whether the orchestration context is replaying history.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
durable_execution()decorator indatadog_lambda/durable.pythat wraps durable orchestration functionsnot context.state.is_replaying()and sets thedurable_function_first_invocationtag ("true"or"false") on the active spanTest plan
test_sets_first_invocation_true_when_not_replaying— tag is"true"when context is not replayingtest_sets_first_invocation_false_when_replaying— tag is"false"when context is replayingtest_does_not_set_tag_when_no_active_span— no error when span isNonetest_does_not_raise_when_context_has_no_state— graceful handling of unexpected context shapetest_preserves_function_name—functools.wrapsis applied correctlypytest tests/test_durable.py— all 18 tests pass🤖 Generated with Claude Code