← Back to Pull requests

feat: [SVLS-9168] add aws.durable.operation_attempt tag to durable operation spans #8595

Closed
unknown closed this pull request without merging on Jun 30, 2026 18:57 UTC
View on GitHub
unknown unknown commented on May 21, 2026 18:22 UTC
Author

What does this PR do?

Adds aws.durable.operation_attempt (numeric metric) to aws.durable.step and aws.durable.wait_for_condition spans. The value is 0-indexed — the number of prior failed attempts:

  • 0 — original attempt

  • 1 — first retry

  • 2 — second retry

  • etc.
  • Sourced from the Durable Execution SDK's StepDetails.Attempt field on the checkpoint, passed through as-is. When no checkpoint exists yet (the very first execution before any prior failures), the tag defaults to 0.

    Motivation

    Mirrors dd-trace-py #18191 and #18520 so the JS tracer surfaces the same retry-attempt signal.

    Why only step and wait_for_condition spans?

    The SDK has six durable operations; only two use the StepDetails.Attempt retry mechanism:

    | Operation | Detail field on checkpoint | Has retry? |
    |---|---|---|
    | step | StepDetails | yes |
    | waitForCondition | StepDetails (polling iterations) | yes |
    | createCallback | CallbackDetails | no |
    | invoke | ChainedInvokeDetails | no |
    | runInChildContext | — | no |
    | wait | WaitDetails | no |

    waitForCallback isn't its own retryable operation — it internally calls createCallback + step, so any retries appear on the inner aws.durable.step child span (already covered). map and parallel decompose into MapIteration / ParallelBranch child operations, which the runInChildContext suppression filter already strips.

    Additional Notes

    Stacked on #8012 (Joey's aws-durable-execution-sdk-js instrumentation). Once that merges, retarget to master.

    Testing

    Installed the tracer on a Lambda durable function. The function has a step step-1 which fails twice then succeeds.

    Original attempt: aws.durable.operation_attempt is 0 (link)
    <img width="474" height="428" alt="image" src="https://github.com/user-attachments/assets/77abbabb-e7c8-4beb-bd2e-092a3f229e7a" />

    2nd attempt (1st retry): aws.durable.operation_attempt is 1 (link)
    <img width="317" height="203" alt="image" src="https://github.com/user-attachments/assets/f38677b5-e9f4-43bd-85a1-f7d608a07a78" />

    3nd attempt (2nd retry): aws.durable.operation_attempt is 2 (link)
    <img width="304" height="205" alt="image" src="https://github.com/user-attachments/assets/53868429-f796-45e4-95a4-e89562aebb54" />

    Diff: 595 lines (+446 / -149) across 7 files Reviewer: crysmags Review duration: 57634m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 595 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.382
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #8595"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50% (MEDIUM) · Higher = larger blast radius
    50%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.8% · Safe to merge
    19.8%