refactor(durable): [SVLS-9168] Extract operation span names as constants#18384
Conversation
Add aws.durable.operation_retry_attempt to aws.durable.step and aws.durable.wait_for_condition spans, sourced from the SDK's StepDetails.attempt checkpoint field. 0 = original attempt, N = Nth retry. Set as a numeric metric so it supports range queries. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…try_attempt Match the style of the other span-attribute setters in the same subscriber. The wire result is identical — _set_attribute dispatches by value type, so an int still lands in the metrics dict as a float. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…-indexed in prod The AWS Lambda Durable service reports `step_details.attempt` 1-indexed (1 for the first attempt, 2 after the first retry), not 0-indexed like the SDK's own documented semantic. Subtract 1 (clamped to 0) so the tag emits the user-facing retry count: 0 for the original attempt, 1 for the first retry, etc. Updates the test_step_with_retry snapshot: the retry-success span's value drops from 1 to 0 because the SDK testing framework already returns step_details.attempt as the retry count directly. The test framework and prod disagree on the semantics; the AIDEV-NOTE in patch.py captures the discrepancy. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ttempt Rename `aws.durable.operation_retry_attempt` to `aws.durable.operation_attempt`. Semantics remain 0-indexed: 0 = original attempt, 1 = first retry, etc. - TAG_OPERATION_RETRY_ATTEMPT renamed to TAG_OPERATION_ATTEMPT - AwsDurableOperationEvent field renamed accordingly - Snapshot keys updated; values unchanged Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…indexed Match the AWS UI's attempt-count convention: 1 = original attempt, 2 = first retry, etc. Pass step_details.attempt through directly (it's already 1-indexed in production); default to 1 when no checkpoint exists yet, and clamp with max(1, …) to handle the SDK testing framework's 0-indexed values. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…t tag Switch aws.durable.operation_attempt to 0-indexed semantics: 0 = original attempt, 1 = first retry, 2 = second retry, etc. Production logging confirmed the server stores step_details.attempt as the count of prior checkpointed attempts (0 when no checkpoint exists, 1 after the first failure, etc.). Passing it through directly avoids the collision where both the first and second attempt emitted 1 under the previous max(1, attempt) logic. Both prod and the test framework use the same underlying convention, so test and prod are now consistent. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… AIDEV-NOTE Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…t AIDEV-NOTE Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…s in ext module Replace bare "aws.durable.*" string literals in patch.py with named constants imported from ddtrace/ext/aws_durable.py. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Codeowners resolved as |
|
BenchmarksBenchmark execution time: 2026-06-01 17:24:01 Comparing candidate commit 83aaa78 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 385 metrics, 9 unstable metrics. scenario:span-start
scenario:telemetryaddmetric-1-count-metric-1-times
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Tests failed on this commit 3e29909: What to do next?
|
What does this PR do?
Extracts all
"aws.durable.*"span name string literals frompatch.pyinto named constants inddtrace/ext/aws_durable.py, then replaces every bare literal with the corresponding constant.New constants added to
ddtrace/ext/aws_durable.py:SPAN_STEPSPAN_WAITSPAN_WAIT_FOR_CONDITIONSPAN_WAIT_FOR_CALLBACKSPAN_CREATE_CALLBACKSPAN_MAPSPAN_PARALLELSPAN_CHILD_CONTEXTMotivation
Addresses reviewer feedback on #18191: span name strings should be constants rather than bare literals so they are defined in one place and typos are caught at import time.
Testing
No behavior change — span names are identical. Existing integration tests cover the affected code paths.