Skip to content

feat: [SVLS-8720] Add span tag aws_lambda.durable_function.first_invocation#747

Open
lym953 wants to merge 7 commits intomainfrom
yiming.luo/durable-first-invocation-tag
Open

feat: [SVLS-8720] Add span tag aws_lambda.durable_function.first_invocation#747
lym953 wants to merge 7 commits intomainfrom
yiming.luo/durable-first-invocation-tag

Conversation

@lym953
Copy link
Contributor

@lym953 lym953 commented Mar 13, 2026

Summary

  • For durable functions, add aws_lambda.durable_function.first_invocation:true (or false) tag to aws.lambda span
  • The value is derived from len(InitialExecutionState.Operations) == 1, mirroring the SDK's own replay detection logic (ReplayStatus.REPLAY when len > 1, ReplayStatus.NEW otherwise)

This is added to help UI can identify the start time of a durable execution.

Test plan

Unit tests

Passed the added unit tests

Manual tests

Steps

Build a test layer. Install it on a durable function. Invoke it.

Results

The first invocation has aws.lambda.durable_function.first_invocation:true
image

Subsequent invocations all have aws.lambda.durable_function.first_invocation:false
image

(query link)

@lym953 lym953 force-pushed the yiming.luo/durable-first-invocation-tag branch 2 times, most recently from 81cd12a to 03bea5b Compare March 19, 2026 13:07
Extends extract_durable_function_tags() to accept context.state and
sets durable_function_first_invocation ("true"/"false") using
not state.is_replaying(). wrapper._before() passes context.state
to the function.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lym953 lym953 force-pushed the yiming.luo/durable-first-invocation-tag branch from 03bea5b to c64baa8 Compare March 19, 2026 13:07
lym953 and others added 2 commits March 19, 2026 14:46
Extends extract_durable_function_tags() to set
durable_function_first_invocation ("true"/"false") by checking
len(InitialExecutionState.Operations) <= 1, mirroring the SDK's
own replay detection logic (ReplayStatus.REPLAY when len > 1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lym953 lym953 force-pushed the yiming.luo/durable-first-invocation-tag branch from bcfb258 to 7fee216 Compare March 19, 2026 14:02
@lym953 lym953 changed the title Add durable_function_first_invocation tag to aws.lambda spans feat: [SVLS-8720] Add durable_function_first_invocation tag to aws.lambda spans Mar 19, 2026
@lym953 lym953 marked this pull request as ready for review March 19, 2026 14:43
@lym953 lym953 requested review from a team as code owners March 19, 2026 14:43
@lym953 lym953 force-pushed the yiming.luo/durable-first-invocation-tag branch from d184ba7 to 392bc43 Compare March 24, 2026 16:51
@lym953 lym953 changed the title feat: [SVLS-8720] Add durable_function_first_invocation tag to aws.lambda spans Add aws.lambda.durable_function.first_invocation tag to aws.lambda spans Mar 24, 2026
@lym953 lym953 changed the title Add aws.lambda.durable_function.first_invocation tag to aws.lambda spans feat: [SVLS-8720] Add durable_function_first_invocation tag Mar 24, 2026
@lym953 lym953 changed the title feat: [SVLS-8720] Add durable_function_first_invocation tag feat: [SVLS-8720] Add span tag aws.lambda.durable_function.first_invocation Mar 24, 2026
lym953 and others added 2 commits March 24, 2026 13:48
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lym953 lym953 changed the title feat: [SVLS-8720] Add span tag aws.lambda.durable_function.first_invocation feat: [SVLS-8720] Add span tag aws_lambda.durable_function.first_invocation Mar 24, 2026
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