Skip to content

fix(aws-durable-execution-sdk-js): [SVLS-8588] set span type to serverless#9162

Merged
lym953 merged 3 commits into
masterfrom
yiming.luo/durable-span-type-serverless
Jul 6, 2026
Merged

fix(aws-durable-execution-sdk-js): [SVLS-8588] set span type to serverless#9162
lym953 merged 3 commits into
masterfrom
yiming.luo/durable-span-type-serverless

Conversation

@lym953

@lym953 lym953 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Durable execution spans (aws.durable.execute, aws.durable.step, aws.durable.wait, etc.) emitted by the JS integration carry an empty span.type, whereas the equivalent dd-trace-py spans are typed serverless.

The plugins already declare the intended type:

class BaseContextPlugin extends TracingPlugin {
  static type = 'serverless'
  static kind = 'internal'

but it never reached the span.

As a result, on traces view, when the active span is a durable function span such as aws.durable.execute or aws.durable.step, the Infrastructure tab is empty because this tab relies on type to display content.

image

Fix

Forward type: this.constructor.type alongside the existing kind in both bindStart calls (context.js, handler.js).

Test

Now the Infrastructure tab shows content as expected.
image

lym953 and others added 2 commits June 30, 2026 15:44
A durable operation served from a FAILED checkpoint on replay (the SDK
re-raises the stored error without running the body) was not recognized as a
replay: both `aws.durable.replayed` and the `aws.durable.operation_attempt`
normalization keyed only on `Status === 'SUCCEEDED'`.

As a result a caught-then-replayed failed operation reported
`replayed=false` and a 1-indexed `operation_attempt` (e.g. 2 for a step whose
2nd attempt failed) — one higher than, and inconsistent with, the live final
attempt (1). This is the same off-by-one #8595 fixed for SUCCEEDED, still open
for FAILED.

Treat a terminal checkpoint (SUCCEEDED or FAILED) as a replay for both tags, so
the replay agrees with the live run (replayed=true, operation_attempt=1).
Verified in production on a durable Lambda.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The durable plugins declare `static type = 'serverless'`, but
`TracingPlugin.startSpan` only defaults `component` from the class —
`type` and `kind` have no `this.constructor.*` fallback. The plugins
forwarded `kind: this.constructor.kind` but omitted `type`, so every
durable span was emitted with an empty `span.type`.

Forward `type: this.constructor.type` in both bindStart calls so the
spans carry `type: serverless`, matching the dd-trace-py integration.
This lets serverless UIs (e.g. the Lambda trace panel's Durable
Function Execution section) recognize the spans as Lambda/function
spans.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@dd-octo-sts

dd-octo-sts Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.55 MB
Deduped: 7.21 MB
No deduping: 7.21 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.0 | 117.14 kB | 432.47 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jun 30, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 87.76% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 49cc577 | Docs | Datadog PR Page | Give us feedback!

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.59%. Comparing base (9bcb78f) to head (49cc577).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9162      +/-   ##
==========================================
- Coverage   93.59%   93.59%   -0.01%     
==========================================
  Files         900      900              
  Lines       52679    52679              
  Branches    12405    12405              
==========================================
- Hits        49306    49305       -1     
- Misses       3373     3374       +1     
Flag Coverage Δ
aiguard 34.98% <ø> (-0.08%) ⬇️
aiguard-integration 41.98% <ø> (ø)
apm-bucket-0 34.84% <ø> (-0.08%) ⬇️
apm-bucket-1 40.51% <ø> (-0.07%) ⬇️
apm-bucket-2 37.50% <ø> (-0.07%) ⬇️
apm-capabilities-tracing 48.95% <ø> (ø)
apm-integrations-aerospike 33.13% <ø> (-0.08%) ⬇️
apm-integrations-confluentinc-kafka-javascript 40.03% <ø> (-0.17%) ⬇️
apm-integrations-couchbase 33.41% <ø> (-0.08%) ⬇️
apm-integrations-http 42.05% <ø> (-0.07%) ⬇️
apm-integrations-kafkajs 40.26% <ø> (-0.08%) ⬇️
apm-integrations-next 29.63% <ø> (-0.08%) ⬇️
apm-integrations-prisma 35.18% <ø> (-0.07%) ⬇️
apm-integrations-tedious 34.04% <ø> (-0.08%) ⬇️
appsec 57.90% <ø> (+0.01%) ⬆️
appsec-express_fastify_graphql 53.84% <ø> (-0.08%) ⬇️
appsec-integration 35.61% <ø> (ø)
appsec-kafka_ldapjs_lodash 43.76% <ø> (-0.07%) ⬇️
appsec-mongodb-core_mongoose_mysql 48.90% <ø> (-0.06%) ⬇️
appsec-next 28.05% <ø> (-0.07%) ⬇️
appsec-node-serialize_passport_postgres 48.09% <ø> (-0.06%) ⬇️
appsec-sourcing_stripe_template 45.64% <ø> (-0.18%) ⬇️
debugger 44.63% <ø> (ø)
instrumentations-bucket-0 28.16% <ø> (-0.08%) ⬇️
instrumentations-bucket-1 37.57% <ø> (-0.07%) ⬇️
instrumentations-bucket-10 40.51% <ø> (-0.07%) ⬇️
instrumentations-bucket-11 27.96% <ø> (-0.08%) ⬇️
instrumentations-bucket-12 28.79% <ø> (-0.08%) ⬇️
instrumentations-bucket-13 27.79% <ø> (-0.08%) ⬇️
instrumentations-bucket-2 30.36% <ø> (-0.08%) ⬇️
instrumentations-bucket-3 36.06% <ø> (-0.08%) ⬇️
instrumentations-bucket-4 28.57% <ø> (-0.08%) ⬇️
instrumentations-bucket-5 36.42% <ø> (-0.07%) ⬇️
instrumentations-bucket-6 38.42% <ø> (-0.08%) ⬇️
instrumentations-bucket-7 36.16% <ø> (-0.07%) ⬇️
instrumentations-bucket-8 37.11% <ø> (-0.07%) ⬇️
instrumentations-bucket-9 39.61% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-couchbase 46.48% <ø> (ø)
instrumentations-integration-esbuild 24.48% <ø> (+0.02%) ⬆️
llmobs-ai_anthropic_bedrock 39.68% <ø> (-0.07%) ⬇️
llmobs-google-genai_langchain_vertex-ai 36.98% <ø> (-0.18%) ⬇️
llmobs-openai 39.74% <ø> (-0.07%) ⬇️
llmobs-sdk 43.59% <ø> (-0.08%) ⬇️
master-coverage 93.59% <ø> (?)
openfeature 37.94% <ø> (ø)
openfeature-unit 50.47% <ø> (ø)
platform-core_esbuild_instrumentations-misc 22.92% <ø> (ø)
platform-integration 47.58% <ø> (ø)
platform-shimmer_unit-guardrails_webpack 18.44% <ø> (ø)
plugins-bucket-0 36.52% <ø> (-0.07%) ⬇️
plugins-bucket-1 39.78% <ø> (ø)
plugins-bucket-11 38.63% <ø> (-0.08%) ⬇️
plugins-bucket-17 39.22% <ø> (-0.07%) ⬇️
plugins-bucket-18 42.17% <ø> (-0.07%) ⬇️
plugins-bucket-19 39.97% <ø> (-0.07%) ⬇️
plugins-bucket-20 43.38% <ø> (-0.13%) ⬇️
plugins-bucket-4 37.88% <ø> (-0.07%) ⬇️
plugins-bullmq_cassandra_cookie 39.93% <ø> (-0.07%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 33.22% <ø> (-0.08%) ⬇️
plugins-fetch_fs_generic-pool 36.21% <ø> (-0.08%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 43.08% <ø> (-0.07%) ⬇️
plugins-hapi_hono_ioredis 37.94% <ø> (-0.07%) ⬇️
plugins-jest_knex_langgraph 32.61% <ø> (-0.08%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 27.92% <ø> (-0.02%) ⬇️
plugins-lodash_mariadb_memcached 35.17% <ø> (-0.08%) ⬇️
plugins-mongodb_mongodb-core_mongoose 36.46% <ø> (-0.07%) ⬇️
plugins-multer_mysql_mysql2 35.15% <ø> (-0.08%) ⬇️
plugins-nats_node-serialize_opensearch 37.31% <ø> (-0.08%) ⬇️
plugins-passport-http_pino_postgres 35.53% <ø> (-0.08%) ⬇️
plugins-process_pug_redis 34.26% <ø> (-0.09%) ⬇️
plugins-undici_url_valkey 36.03% <ø> (-0.07%) ⬇️
plugins-vm_winston_ws 37.72% <ø> (-0.08%) ⬇️
profiling 43.83% <ø> (-0.07%) ⬇️
serverless-aws-sdk-aws-sdk 33.32% <ø> (-0.07%) ⬇️
serverless-aws-sdk-bedrockruntime 32.19% <ø> (-0.07%) ⬇️
serverless-aws-sdk-client 37.16% <ø> (ø)
serverless-aws-sdk-dynamodb 34.13% <ø> (-0.07%) ⬇️
serverless-aws-sdk-eventbridge 27.36% <ø> (-0.07%) ⬇️
serverless-aws-sdk-kinesis 37.55% <ø> (-0.07%) ⬇️
serverless-aws-sdk-lambda 34.64% <ø> (-0.07%) ⬇️
serverless-aws-sdk-s3 32.63% <ø> (-0.07%) ⬇️
serverless-aws-sdk-serverless-peer-service 39.65% <ø> (-0.08%) ⬇️
serverless-aws-sdk-sns 38.40% <ø> (-0.07%) ⬇️
serverless-aws-sdk-sqs 38.14% <ø> (-0.07%) ⬇️
serverless-aws-sdk-stepfunctions 33.22% <ø> (-0.07%) ⬇️
serverless-aws-sdk-util 47.95% <ø> (ø)
serverless-bucket-0 39.63% <ø> (ø)
serverless-lambda 34.34% <ø> (-0.09%) ⬇️
test-optimization-cucumber 52.35% <ø> (+0.11%) ⬆️
test-optimization-cypress 50.05% <ø> (+0.06%) ⬆️
test-optimization-jest 55.57% <ø> (+0.14%) ⬆️
test-optimization-mocha 53.52% <ø> (+0.11%) ⬆️
test-optimization-playwright-playwright-atr 43.43% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-efd 43.71% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-final-status 43.83% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-impacted-tests 43.26% <ø> (ø)
test-optimization-playwright-playwright-reporting 43.37% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-test-management 44.83% <ø> (+0.08%) ⬆️
test-optimization-playwright-playwright-test-span 44.62% <ø> (+0.07%) ⬆️
test-optimization-selenium 45.41% <ø> (+0.06%) ⬆️
test-optimization-testopt 46.74% <ø> (+0.08%) ⬆️
test-optimization-vitest 52.67% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter

pr-commenter Bot commented Jun 30, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-06 16:11:38

Comparing candidate commit 49cc577 in PR branch yiming.luo/durable-span-type-serverless with baseline commit 9bcb78f in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2247 metrics, 39 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-180760.767µs; +179833.200µs] or [-6.847%; +6.812%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-199.728ms; +202.706ms] or [-7.920%; +8.038%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-150.758ms; +158.625ms] or [-5.214%; +5.486%]

scenario:appsec-control-24

  • unstable execution_time [-107.797ms; +102.227ms] or [-8.871%; +8.413%]

scenario:appsec-control-26

  • unstable execution_time [-109.544ms; +112.165ms] or [-9.088%; +9.305%]

scenario:debugger-enabled-but-breakpoint-not-hit-24

  • unstable cpu_user_time [-830.196ms; +1424.564ms] or [-7.193%; +12.342%]
  • unstable execution_time [-817.093ms; +1421.423ms] or [-7.058%; +12.278%]
  • unstable throughput [-2009.492op/s; +1134.195op/s] or [-10.521%; +5.938%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-1851.601ms; +2482.242ms] or [-21.869%; +29.318%]
  • unstable execution_time [-1905.716ms; +2510.562ms] or [-20.793%; +27.392%]
  • unstable instructions [-15.6G instructions; +21.1G instructions] or [-22.587%; +30.674%]
  • unstable max_rss_usage [-6.142MB; +10.138MB] or [-3.912%; +6.457%]
  • unstable throughput [-690.400op/s; +577.491op/s] or [-19.334%; +16.172%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-1804.859ms; +580.018ms] or [-19.249%; +6.186%]
  • unstable execution_time [-1817.039ms; +576.471ms] or [-18.044%; +5.725%]
  • unstable instructions [-16.2G instructions; +5.0G instructions] or [-20.798%; +6.431%]
  • unstable throughput [-132.109op/s; +413.273op/s] or [-4.055%; +12.685%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-1643.493ms; +2632.612ms] or [-19.757%; +31.648%]
  • unstable execution_time [-1672.099ms; +2684.403ms] or [-18.554%; +29.787%]
  • unstable instructions [-14.0G instructions; +22.6G instructions] or [-20.646%; +33.278%]
  • unstable max_rss_usage [-7.116MB; +11.028MB] or [-4.537%; +7.031%]
  • unstable throughput [-765.152op/s; +476.244op/s] or [-21.067%; +13.113%]

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable cpu_user_time [-2191.051ms; +3361.849ms] or [-23.669%; +36.316%]
  • unstable execution_time [-2208.629ms; +3411.497ms] or [-22.230%; +34.337%]
  • unstable instructions [-19.1G instructions; +30.1G instructions] or [-24.800%; +39.075%]
  • unstable max_rss_usage [-7.061MB; +9.695MB] or [-4.417%; +6.065%]
  • unstable throughput [-756.535op/s; +501.296op/s] or [-22.822%; +15.122%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-143.338ms; +816.496ms] or [-1.859%; +10.591%]
  • unstable execution_time [-144.850ms; +820.364ms] or [-1.725%; +9.768%]
  • unstable instructions [-1.4G instructions; +7.4G instructions] or [-2.245%; +11.814%]
  • unstable throughput [-371.381op/s; +62.271op/s] or [-9.679%; +1.623%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-1855.839ms; +586.801ms] or [-19.859%; +6.279%]
  • unstable execution_time [-1884.542ms; +575.808ms] or [-18.786%; +5.740%]
  • unstable instructions [-16.9G instructions; +5.0G instructions] or [-21.818%; +6.416%]
  • unstable throughput [-129.548op/s; +433.299op/s] or [-3.956%; +13.230%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-252.540ms; +478.728ms] or [-5.134%; +9.732%]
  • unstable execution_time [-252.140ms; +475.673ms] or [-5.051%; +9.528%]
  • unstable throughput [-163572.143op/s; +88484.986op/s] or [-9.715%; +5.255%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-4.357MB; +7.895MB] or [-5.378%; +9.745%]

@lym953
lym953 requested a review from a team June 30, 2026 21:04
@lym953 lym953 changed the title fix(aws-durable-execution-sdk-js): set span type to serverless fix(aws-durable-execution-sdk-js): [SVLS-8588] set span type to serverless Jun 30, 2026
@lym953
lym953 marked this pull request as ready for review June 30, 2026 21:04
@lym953
lym953 requested a review from a team as a code owner June 30, 2026 21:04
@lym953
lym953 requested review from tlhunter and removed request for a team June 30, 2026 21:04
Base automatically changed from yiming.luo/durable-failed-replay-attempt to master July 1, 2026 15:11
@lucaspimentel
lucaspimentel requested a review from Copilot July 2, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes aws-durable-execution-sdk-js integration spans emitting an empty span.type by forwarding the plugin-declared type (serverless) into span creation, aligning behavior with other tracers and restoring Infra tab content for durable execution spans.

Changes:

  • Forward type: this.constructor.type into startSpan() for both execute spans (handler.js) and operation spans (context.js).
  • Normalize replay detection / attempt normalization to treat FAILED checkpoints like SUCCEEDED checkpoints (util.js).
  • Add integration test coverage asserting span.type === 'serverless' and add a regression test for replayed permanently-failed step attempt normalization (index.spec.js).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/datadog-plugin-aws-durable-execution-sdk-js/src/handler.js Passes plugin static type into the execute span start options so span.type is set.
packages/datadog-plugin-aws-durable-execution-sdk-js/src/context.js Passes plugin static type into operation span start options so child spans get span.type.
packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js Treats FAILED checkpoints as replay terminal states for replayed tagging and attempt normalization.
packages/datadog-plugin-aws-durable-execution-sdk-js/test/index.spec.js Adds assertions for span.type = serverless and a regression test for replayed FAILED checkpoint attempt normalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lym953
lym953 merged commit f3dba8a into master Jul 6, 2026
652 checks passed
@lym953
lym953 deleted the yiming.luo/durable-span-type-serverless branch July 6, 2026 18:50
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 7, 2026
…rless (#9162)

* fix(aws-durable-execution-sdk-js): treat FAILED checkpoints as replays

A durable operation served from a FAILED checkpoint on replay (the SDK
re-raises the stored error without running the body) was not recognized as a
replay: both `aws.durable.replayed` and the `aws.durable.operation_attempt`
normalization keyed only on `Status === 'SUCCEEDED'`.

As a result a caught-then-replayed failed operation reported
`replayed=false` and a 1-indexed `operation_attempt` (e.g. 2 for a step whose
2nd attempt failed) — one higher than, and inconsistent with, the live final
attempt (1). This is the same off-by-one #8595 fixed for SUCCEEDED, still open
for FAILED.

Treat a terminal checkpoint (SUCCEEDED or FAILED) as a replay for both tags, so
the replay agrees with the live run (replayed=true, operation_attempt=1).
Verified in production on a durable Lambda.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(aws-durable-execution-sdk-js): set span type to serverless

The durable plugins declare `static type = 'serverless'`, but
`TracingPlugin.startSpan` only defaults `component` from the class —
`type` and `kind` have no `this.constructor.*` fallback. The plugins
forwarded `kind: this.constructor.kind` but omitted `type`, so every
durable span was emitted with an empty `span.type`.

Forward `type: this.constructor.type` in both bindStart calls so the
spans carry `type: serverless`, matching the dd-trace-py integration.
This lets serverless UIs (e.g. the Lambda trace panel's Durable
Function Execution section) recognize the spans as Lambda/function
spans.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 7, 2026
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 7, 2026
…rless (#9162)

* fix(aws-durable-execution-sdk-js): treat FAILED checkpoints as replays

A durable operation served from a FAILED checkpoint on replay (the SDK
re-raises the stored error without running the body) was not recognized as a
replay: both `aws.durable.replayed` and the `aws.durable.operation_attempt`
normalization keyed only on `Status === 'SUCCEEDED'`.

As a result a caught-then-replayed failed operation reported
`replayed=false` and a 1-indexed `operation_attempt` (e.g. 2 for a step whose
2nd attempt failed) — one higher than, and inconsistent with, the live final
attempt (1). This is the same off-by-one #8595 fixed for SUCCEEDED, still open
for FAILED.

Treat a terminal checkpoint (SUCCEEDED or FAILED) as a replay for both tags, so
the replay agrees with the live run (replayed=true, operation_attempt=1).
Verified in production on a durable Lambda.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(aws-durable-execution-sdk-js): set span type to serverless

The durable plugins declare `static type = 'serverless'`, but
`TracingPlugin.startSpan` only defaults `component` from the class —
`type` and `kind` have no `this.constructor.*` fallback. The plugins
forwarded `kind: this.constructor.kind` but omitted `type`, so every
durable span was emitted with an empty `span.type`.

Forward `type: this.constructor.type` in both bindStart calls so the
spans carry `type: serverless`, matching the dd-trace-py integration.
This lets serverless UIs (e.g. the Lambda trace panel's Durable
Function Execution section) recognize the spans as Lambda/function
spans.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 7, 2026
juan-fernandez pushed a commit that referenced this pull request Jul 8, 2026
…rless (#9162)

* fix(aws-durable-execution-sdk-js): treat FAILED checkpoints as replays

A durable operation served from a FAILED checkpoint on replay (the SDK
re-raises the stored error without running the body) was not recognized as a
replay: both `aws.durable.replayed` and the `aws.durable.operation_attempt`
normalization keyed only on `Status === 'SUCCEEDED'`.

As a result a caught-then-replayed failed operation reported
`replayed=false` and a 1-indexed `operation_attempt` (e.g. 2 for a step whose
2nd attempt failed) — one higher than, and inconsistent with, the live final
attempt (1). This is the same off-by-one #8595 fixed for SUCCEEDED, still open
for FAILED.

Treat a terminal checkpoint (SUCCEEDED or FAILED) as a replay for both tags, so
the replay agrees with the live run (replayed=true, operation_attempt=1).
Verified in production on a durable Lambda.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(aws-durable-execution-sdk-js): set span type to serverless

The durable plugins declare `static type = 'serverless'`, but
`TracingPlugin.startSpan` only defaults `component` from the class —
`type` and `kind` have no `this.constructor.*` fallback. The plugins
forwarded `kind: this.constructor.kind` but omitted `type`, so every
durable span was emitted with an empty `span.type`.

Forward `type: this.constructor.type` in both bindStart calls so the
spans carry `type: serverless`, matching the dd-trace-py integration.
This lets serverless UIs (e.g. the Lambda trace panel's Durable
Function Execution section) recognize the spans as Lambda/function
spans.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
juan-fernandez pushed a commit that referenced this pull request Jul 8, 2026
…rless (#9162)

* fix(aws-durable-execution-sdk-js): treat FAILED checkpoints as replays

A durable operation served from a FAILED checkpoint on replay (the SDK
re-raises the stored error without running the body) was not recognized as a
replay: both `aws.durable.replayed` and the `aws.durable.operation_attempt`
normalization keyed only on `Status === 'SUCCEEDED'`.

As a result a caught-then-replayed failed operation reported
`replayed=false` and a 1-indexed `operation_attempt` (e.g. 2 for a step whose
2nd attempt failed) — one higher than, and inconsistent with, the live final
attempt (1). This is the same off-by-one #8595 fixed for SUCCEEDED, still open
for FAILED.

Treat a terminal checkpoint (SUCCEEDED or FAILED) as a replay for both tags, so
the replay agrees with the live run (replayed=true, operation_attempt=1).
Verified in production on a durable Lambda.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(aws-durable-execution-sdk-js): set span type to serverless

The durable plugins declare `static type = 'serverless'`, but
`TracingPlugin.startSpan` only defaults `component` from the class —
`type` and `kind` have no `this.constructor.*` fallback. The plugins
forwarded `kind: this.constructor.kind` but omitted `type`, so every
durable span was emitted with an empty `span.type`.

Forward `type: this.constructor.type` in both bindStart calls so the
spans carry `type: serverless`, matching the dd-trace-py integration.
This lets serverless UIs (e.g. the Lambda trace panel's Durable
Function Execution section) recognize the spans as Lambda/function
spans.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants