Skip to content

feat(azure-functions): instrument Durable Functions orchestration triggers - #9594

Draft
chemystery09 wants to merge 5 commits into
azure-durable-functions-trace-propagationfrom
azure-durable-functions-orchestration-spans
Draft

feat(azure-functions): instrument Durable Functions orchestration triggers#9594
chemystery09 wants to merge 5 commits into
azure-durable-functions-trace-propagationfrom
azure-durable-functions-orchestration-spans

Conversation

@chemystery09

@chemystery09 chemystery09 commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • Instruments Durable Functions orchestration triggers via app.generic on @azure/functions, publishing to the existing azure-durable-functions channel as Orchestration <name> spans.
  • Skips replaying orchestrator invocations (isReplaying !== false) so replays do not duplicate spans.
  • Continues host W3C traceparent/tracestate into the span context (same path as activities/entities from fix(azure-durable-functions): link activity and entity spans to the HTTP trace #9394).
  • Adds a unit test covering orchestration resource naming on the durable plugin.

Stacked on #9394 (azure-durable-functions-trace-propagation) which allows activity and entity spans to be visible, so this PR only contains the orchestration-span change.

Before
image
Trace link
After
image
Trace link

Test plan

  • Unit: packages/datadog-plugin-azure-durable-functions/test/index.spec.js (orchestration naming case)
  • Manual / A/B on a Node Durable Functions app (default storage or DTS) with tracing.distributedTracingEnabled + version: V2
    • with this branch: expect Orchestration <name> spans linked into the HTTP trace
    • without the app.generic wrap: expect activities only

Made with Cursor

…ggers

Orchestrators register through app.generic rather than the durable-functions
activity/entity APIs, so wrap that path and emit Orchestration spans on the
existing durable-functions channel. Skip replaying invocations to avoid
duplicate spans.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dd-octo-sts

dd-octo-sts Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 7.57 MB
Deduped: 8.23 MB
No deduping: 8.23 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.2 | 124.41 kB | 440.65 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-6

datadog-prod-us1-6 Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

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

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

Tighten comments and add unit tests for app.generic orchestration wrapping,
replay skipping, and Orchestration span naming/propagation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@pr-commenter

pr-commenter Bot commented Jul 29, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-29 22:30:40

Comparing candidate commit 2a0a8f3 in PR branch azure-durable-functions-orchestration-spans with baseline commit d63d6ed in branch azure-durable-functions-trace-propagation.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2318 metrics, 40 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 [-202.985ms; +212.163ms] or [-7.628%; +7.973%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-201.978ms; +259.674ms] or [-7.980%; +10.259%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-161.634ms; +166.511ms] or [-5.227%; +5.385%]

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

  • unstable execution_time [-181.897ms; +178.775ms] or [-6.255%; +6.147%]

scenario:appsec-control-20

  • unstable execution_time [-126.516ms; +119.003ms] or [-7.714%; +7.256%]

scenario:appsec-control-24

  • unstable execution_time [-104.543ms; +96.110ms] or [-8.539%; +7.851%]

scenario:appsec-control-26

  • unstable execution_time [-131.770ms; +118.503ms] or [-10.673%; +9.598%]

scenario:appsec-iast-no-vulnerability-control-20

  • unstable execution_time [-22.284ms; +15.561ms] or [-8.625%; +6.023%]

scenario:appsec-iast-no-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-10.803ms; +19.157ms] or [-4.263%; +7.559%]

scenario:appsec-iast-with-vulnerability-control-20

  • unstable execution_time [-26.308ms; +34.299ms] or [-4.825%; +6.291%]

scenario:appsec-iast-with-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-24.972ms; +31.090ms] or [-4.549%; +5.663%]

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

  • unstable cpu_user_time [-554.951ms; +919.889ms] or [-4.011%; +6.648%]
  • unstable execution_time [-567.231ms; +944.763ms] or [-3.892%; +6.482%]
  • unstable instructions [-5.3G instructions; +8.6G instructions] or [-4.348%; +7.030%]

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

  • unstable cpu_user_time [-1757.770ms; +578.332ms] or [-21.117%; +6.948%]
  • unstable execution_time [-1803.989ms; +567.533ms] or [-19.985%; +6.287%]
  • unstable instructions [-15.1G instructions; +4.7G instructions] or [-22.340%; +6.992%]
  • unstable throughput [-147.872op/s; +478.461op/s] or [-4.050%; +13.105%]

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

  • unstable cpu_user_time [-2602.141ms; +4166.197ms] or [-27.247%; +43.625%]
  • unstable execution_time [-2576.046ms; +4185.008ms] or [-25.061%; +40.714%]
  • unstable instructions [-23.4G instructions; +37.3G instructions] or [-29.463%; +46.831%]
  • unstable max_rss_usage [-8.827MB; +13.040MB] or [-5.555%; +8.206%]
  • unstable throughput [-822.820op/s; +498.776op/s] or [-25.517%; +15.468%]

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

  • unstable cpu_user_time [-2.714s; +5.766s] or [-26.346%; +55.976%]
  • unstable execution_time [-2.728s; +5.793s] or [-24.703%; +52.447%]
  • unstable instructions [-24.0G instructions; +51.6G instructions] or [-27.691%; +59.669%]
  • unstable max_rss_usage [-8.376MB; +18.179MB] or [-5.185%; +11.254%]
  • unstable throughput [-1133.838op/s; +540.914op/s] or [-36.852%; +17.581%]

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

  • unstable cpu_user_time [-2.761s; +0.368s] or [-31.000%; +4.129%]
  • unstable execution_time [-2.766s; +0.387s] or [-28.747%; +4.024%]
  • unstable instructions [-23.3G instructions; +3.1G instructions] or [-32.082%; +4.322%]
  • unstable throughput [-107.887op/s; +730.836op/s] or [-3.087%; +20.910%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-293.218ms; +374.635ms] or [-6.162%; +7.873%]
  • unstable execution_time [-287.324ms; +371.643ms] or [-5.943%; +7.688%]
  • unstable throughput [-131340.861op/s; +101344.481op/s] or [-7.569%; +5.840%]

scenario:plugin-aws-sdk-lambda-inject-with-context-24

  • unstable cpu_user_time [-220.912ms; +210.270ms] or [-5.815%; +5.535%]
  • unstable execution_time [-222.343ms; +211.241ms] or [-5.816%; +5.525%]

scenario:plugin-claude-agent-sdk-compact-stream-scan-26

  • unstable cpu_usage_percentage [-6.136%; +3.917%]

scenario:plugin-graphql-long-with-depth-off-26

  • unstable max_rss_usage [-32582.765KB; +33079.908KB] or [-17.228%; +17.491%]

scenario:plugin-memcached-get-24

  • unstable execution_time [-114.942ms; +166.528ms] or [-4.780%; +6.925%]

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.50%. Comparing base (d63d6ed) to head (2a0a8f3).

Additional details and impacted files
@@                             Coverage Diff                             @@
##           azure-durable-functions-trace-propagation    #9594    +/-   ##
===========================================================================
  Coverage                                      98.50%   98.50%            
===========================================================================
  Files                                            952      952            
  Lines                                         131197   131236    +39     
  Branches                                       11546    11369   -177     
===========================================================================
+ Hits                                          129236   129275    +39     
  Misses                                          1961     1961            
Flag Coverage Δ
aiguard 57.39% <ø> (ø)
aiguard-integration 56.21% <ø> (ø)
apm-bucket-0 57.68% <ø> (+0.04%) ⬆️
apm-bucket-1 63.87% <ø> (ø)
apm-bucket-2 62.63% <ø> (ø)
apm-bucket-3 60.11% <ø> (ø)
apm-capabilities-tracing 62.67% <ø> (ø)
apm-integrations-aerospike 56.69% <ø> (ø)
apm-integrations-confluentinc-kafka-javascript 61.48% <ø> (-0.04%) ⬇️
apm-integrations-couchbase 57.09% <ø> (ø)
apm-integrations-http 62.67% <ø> (ø)
apm-integrations-kafkajs 62.12% <ø> (ø)
apm-integrations-next 59.16% <ø> (ø)
apm-integrations-prisma 58.66% <ø> (ø)
appsec 72.72% <ø> (+0.02%) ⬆️
appsec-express_fastify_graphql 70.22% <ø> (ø)
appsec-integration 50.88% <20.51%> (-0.02%) ⬇️
appsec-kafka_ldapjs_lodash 63.85% <ø> (ø)
appsec-mongodb-core_mongoose_mysql 67.55% <ø> (ø)
appsec-next 57.53% <ø> (ø)
appsec-node-serialize_passport_postgres 67.23% <ø> (ø)
appsec-sourcing_stripe_template 65.59% <ø> (ø)
debugger 64.79% <ø> (+<0.01%) ⬆️
instrumentations-bucket-0 51.54% <100.00%> (-0.28%) ⬇️
instrumentations-bucket-1 60.13% <ø> (-0.06%) ⬇️
instrumentations-bucket-10 61.69% <ø> (-0.30%) ⬇️
instrumentations-bucket-11 56.68% <ø> (+4.95%) ⬆️
instrumentations-bucket-12 52.05% <ø> (-0.25%) ⬇️
instrumentations-bucket-13 52.07% <ø> (+0.22%) ⬆️
instrumentations-bucket-2 53.36% <ø> (-0.35%) ⬇️
instrumentations-bucket-3 53.64% <ø> (-5.57%) ⬇️
instrumentations-bucket-4 59.15% <ø> (+6.77%) ⬆️
instrumentations-bucket-5 50.12% <ø> (-7.47%) ⬇️
instrumentations-bucket-6 60.86% <ø> (+0.12%) ⬆️
instrumentations-bucket-7 58.33% <ø> (-0.09%) ⬇️
instrumentations-bucket-8 59.39% <ø> (-0.16%) ⬇️
instrumentations-bucket-9 52.06% <ø> (-9.45%) ⬇️
instrumentations-instrumentation-couchbase 51.08% <ø> (ø)
instrumentations-instrumentation-zlib 51.72% <ø> (?)
instrumentations-integration-esbuild 34.00% <20.51%> (-0.01%) ⬇️
llmobs-ai_anthropic_bedrock 62.85% <ø> (ø)
llmobs-bucket-1 61.60% <ø> (ø)
llmobs-openai 62.19% <ø> (ø)
llmobs-openai-agents_vertex-ai 60.11% <ø> (-0.01%) ⬇️
llmobs-sdk 65.97% <ø> (ø)
master-coverage 98.50% <100.00%> (+<0.01%) ⬆️
openfeature 56.10% <ø> (ø)
openfeature-unit 53.44% <ø> (ø)
platform-core_esbuild_instrumentations-misc 40.77% <20.51%> (-0.02%) ⬇️
platform-integration 61.05% <ø> (ø)
platform-shimmer_unit-guardrails_webpack 39.04% <20.51%> (-0.02%) ⬇️
plugins-body-parser_bullmq_cassandra 63.66% <ø> (ø)
plugins-bucket-0 57.09% <ø> (ø)
plugins-bucket-1 56.17% <ø> (ø)
plugins-bucket-12 62.11% <ø> (ø)
plugins-bucket-15 59.22% <ø> (ø)
plugins-bucket-18 61.80% <ø> (ø)
plugins-bucket-19 58.50% <ø> (ø)
plugins-bucket-20 61.72% <ø> (ø)
plugins-bucket-21 62.29% <ø> (ø)
plugins-bucket-4 56.71% <ø> (ø)
plugins-cookie_cookie-parser_crypto 51.34% <ø> (ø)
plugins-fastify_fetch_fs 61.11% <ø> (ø)
plugins-generic-pool_google-cloud-pubsub_grpc 64.61% <ø> (ø)
plugins-handlebars_hapi_hono 58.80% <ø> (ø)
plugins-ioredis_jest_knex 57.84% <ø> (ø)
plugins-langgraph_ldapjs_light-my-request 58.02% <ø> (ø)
plugins-limitd-client_lodash_mariadb 57.96% <ø> (ø)
plugins-memcached_mercurius_microgateway-core 61.31% <ø> (ø)
plugins-mongodb-core_mongoose_multer 59.31% <ø> (ø)
plugins-mysql_mysql2_nats 60.93% <ø> (ø)
plugins-pino_postgres_process 58.72% <ø> (ø)
plugins-pug_redis_router 62.10% <ø> (ø)
plugins-url_valkey_vm 57.55% <ø> (ø)
plugins-winston_ws 59.93% <ø> (ø)
profiling 62.11% <ø> (ø)
serverless-aws-sdk-aws-sdk 55.13% <ø> (ø)
serverless-aws-sdk-base-inject-field 51.01% <ø> (ø)
serverless-aws-sdk-bedrockruntime 54.82% <ø> (ø)
serverless-aws-sdk-client 56.48% <ø> (ø)
serverless-aws-sdk-dynamodb 55.70% <ø> (ø)
serverless-aws-sdk-eventbridge 49.51% <ø> (ø)
serverless-aws-sdk-kinesis 59.33% <ø> (ø)
serverless-aws-sdk-lambda 57.43% <ø> (ø)
serverless-aws-sdk-s3 55.80% <ø> (ø)
serverless-aws-sdk-serverless-peer-service 59.75% <ø> (ø)
serverless-aws-sdk-sns 60.18% <ø> (ø)
serverless-aws-sdk-sqs 60.62% <ø> (ø)
serverless-aws-sdk-stepfunctions 55.63% <ø> (ø)
serverless-aws-sdk-util 51.57% <ø> (ø)
serverless-bucket-0 57.96% <100.00%> (+0.04%) ⬆️
serverless-bucket-1 59.23% <35.89%> (-0.03%) ⬇️
test-optimization-cucumber 71.97% <ø> (ø)
test-optimization-cypress 65.80% <ø> (ø)
test-optimization-jest 73.31% <ø> (+0.05%) ⬆️
test-optimization-mocha 73.19% <ø> (ø)
test-optimization-playwright-playwright-atr 60.53% <ø> (ø)
test-optimization-playwright-playwright-efd 60.72% <ø> (ø)
test-optimization-playwright-playwright-final-status 60.84% <ø> (ø)
test-optimization-playwright-playwright-impacted-tests 60.41% <ø> (ø)
test-optimization-playwright-playwright-reporting 61.64% <ø> (-0.08%) ⬇️
test-optimization-playwright-playwright-test-management 61.22% <ø> (ø)
test-optimization-playwright-playwright-test-span 60.62% <ø> (ø)
test-optimization-selenium 60.10% <ø> (ø)
test-optimization-testopt 58.39% <ø> (ø)
test-optimization-vitest 70.68% <ø> (-0.07%) ⬇️
test-optimization-vitest-browser 59.26% <ø> (ø)
test-optimization-webdriverio 64.62% <ø> (ø)

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.

chemystery09 and others added 2 commits July 29, 2026 17:36
The orchestration hook adds a fifth trace to the durable functions
integration run, and the orchestrator is suspended between calls so the
flush order is not stable. Look traces up by resource instead of index.

Co-authored-by: Cursor <cursoragent@cursor.com>
No job set PLUGINS=azure-functions for the instrumentations suite, so the
new orchestration hook spec was never exercised in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
…urable-functions-orchestration-spans

Pick up master fixes merged into the base branch for stacked PR CI.
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.

1 participant