Skip to content

feat(llmobs): add experiment multirun concurrency - #9686

Draft
mehulsonowal wants to merge 2 commits into
feat/llmobs-experiment-recorder-stackedfrom
feat/llmobs-experiment-run-multirun-stacked
Draft

feat(llmobs): add experiment multirun concurrency#9686
mehulsonowal wants to merge 2 commits into
feat/llmobs-experiment-recorder-stackedfrom
feat/llmobs-experiment-run-multirun-stacked

Conversation

@mehulsonowal

@mehulsonowal mehulsonowal commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds local LLMObs experiment multirun and concurrency support for the Node.js SDK:

  • Adds runs to tracer.llmobs.experiments.experiment({ ... }) for local experiments.
  • Adds .run({ concurrency }) to bound concurrent task/evaluator work within each run.
  • Defaults concurrency to 10, matching the Python SDK.
  • Executes runs sequentially while allowing task executions, row evaluators, and summary evaluators to run in parallel up to the configured concurrency limit.
  • Adds per-run result data in result.runs[], with result.rows and result.summaryEvaluations kept as aliases to the first run for compatibility.
  • Adds run_count, UUID run_id, and run_iteration metadata/tags for backend events and metrics.
  • Updates TypeScript declarations and no-op experiment shape.

Motivation

Bring the Node.js experiments API closer to Python SDK behavior and support Omnea-requested local experiment workflows where each dataset row can be evaluated across multiple sequential runs, with bounded parallelism for tasks and evaluators.

Additional Notes

This PR is stacked on feat/llmobs-experiment-recorder-stacked.

run_id generation uses node:crypto.randomUUID() via the experiments util helper to match Python's UUID v4 run IDs.

Validation:

  • ./node_modules/.bin/mocha packages/dd-trace/test/llmobs/experiments/experiment.spec.js packages/dd-trace/test/llmobs/experiments/index.spec.js packages/dd-trace/test/llmobs/experiments/util.spec.js — 44 passing
  • ./node_modules/.bin/eslint packages/dd-trace/src/llmobs/experiments/experiment.js packages/dd-trace/src/llmobs/experiments/noop.js packages/dd-trace/src/llmobs/experiments/util.js packages/dd-trace/test/llmobs/experiments/experiment.spec.js packages/dd-trace/test/llmobs/experiments/index.spec.js
  • git diff --check

End-to-end validation example: DataDog/llm-observability#90 adds a runnable Node.js multirun/concurrency multispan example in experiments/nodejs/examples/04-multirun-concurrency.js for reviewers to validate this feature against these SDK changes.

@dd-octo-sts

dd-octo-sts Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 7.61 MB
Deduped: 8.27 MB
No deduping: 8.27 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.3 | 125.43 kB | 441.68 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-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 4, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

DataDog/apm-reliability/dd-trace-js | benchmark: [20, 3]   View in Datadog   GitLab

🧪 1 Test failed in 1 job

All Green | all-green   GitHub Actions

should increment samplingInstantCount on each sampling instant from Mocha Tests   View in Datadog
Expected 1 > 1

      + expected - actual

      -false
      +true
      
AssertionError [ERR_ASSERTION]: Expected 1 > 1
    at Context.<anonymous> (packages/dd-trace/test/profiling/profilers/poisson.spec.js:197:12)
    at /home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/setup/mocha-hooks.js:56:18

ℹ️ Info

No other issues found (see more)

❄️ 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.52% (+0.00%)

Useful? React with 👍 / 👎

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

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.91133% with 382 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.62%. Comparing base (202039c) to head (0e5f512).

Files with missing lines Patch % Lines
...ages/dd-trace/src/llmobs/experiments/experiment.js 2.64% 368 Missing ⚠️
packages/dd-trace/src/llmobs/experiments/noop.js 0.00% 7 Missing ⚠️
packages/dd-trace/src/llmobs/experiments/util.js 66.66% 7 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (202039c) and HEAD (0e5f512). Click for more details.

HEAD has 37 uploads less than BASE
Flag BASE (202039c) HEAD (0e5f512)
appsec-next 1 0
openfeature-unit 1 0
llmobs-sdk 1 0
instrumentations-integration-esbuild 1 0
llmobs-ai_anthropic_bedrock 1 0
openfeature 1 0
plugins-bucket-1 1 0
platform-shimmer_unit-guardrails_webpack 1 0
platform-integration 1 0
llmobs-openai-agents_vertex-ai 1 0
plugins-bucket-0 1 0
llmobs-bucket-1 1 0
plugins-jest_knex_langgraph 1 0
plugins-hapi_hono_ioredis 1 0
plugins-ldapjs_light-my-request_limitd-client 1 0
plugins-lodash_mariadb_memcached 1 0
serverless-aws-sdk-base-inject-field 1 0
serverless-aws-sdk-aws-sdk 1 0
plugins-ws 1 0
plugins-mongoose_multer_mysql 1 0
serverless-aws-sdk-client 1 0
serverless-aws-sdk-bedrockruntime 1 0
plugins-postgres_process_pug 1 0
plugins-valkey_vm_winston 1 0
plugins-moleculer_mongodb_mongodb-core 1 0
plugins-opensearch_passport-http_pino 1 0
serverless-aws-sdk-dynamodb 1 0
plugins-mysql2_nats_node-serialize 1 0
plugins-test-and-upstream-rhea_undici_url 1 0
plugins-redis_router_sequelize 1 0
serverless-aws-sdk-eventbridge 1 0
serverless-aws-sdk-lambda 1 0
serverless-aws-sdk-stepfunctions 1 0
serverless-aws-sdk-serverless-peer-service 1 0
serverless-aws-sdk-sns 1 0
serverless-aws-sdk-util 1 0
test-optimization-cypress 1 0
Additional details and impacted files
@@                             Coverage Diff                             @@
##           feat/llmobs-experiment-recorder-stacked    #9686      +/-   ##
===========================================================================
- Coverage                                    98.51%   89.62%   -8.90%     
===========================================================================
  Files                                          953      931      -22     
  Lines                                       132199   128403    -3796     
  Branches                                     11447    10209    -1238     
===========================================================================
- Hits                                        130237   115078   -15159     
- Misses                                        1962    13325   +11363     
Flag Coverage Δ
aiguard 56.30% <5.91%> (-0.38%) ⬇️
aiguard-integration 55.27% <5.91%> (-0.32%) ⬇️
apm-bucket-0 56.50% <5.91%> (-0.39%) ⬇️
apm-bucket-1 62.72% <5.91%> (-0.39%) ⬇️
apm-bucket-2 61.44% <5.91%> (-0.41%) ⬇️
apm-bucket-3 58.99% <5.91%> (-0.39%) ⬇️
apm-capabilities-tracing 62.12% <5.91%> (-0.18%) ⬇️
apm-integrations-aerospike 55.42% <4.67%> (-0.39%) ⬇️
apm-integrations-confluentinc-kafka-javascript 60.31% <5.91%> (-0.38%) ⬇️
apm-integrations-couchbase 55.99% <5.91%> (-0.38%) ⬇️
apm-integrations-http 61.55% <5.91%> (-0.38%) ⬇️
apm-integrations-kafkajs 60.90% <5.91%> (-0.41%) ⬇️
apm-integrations-next 58.06% <5.91%> (-0.38%) ⬇️
apm-integrations-prisma 57.66% <5.91%> (-0.36%) ⬇️
appsec 71.44% <5.91%> (-0.41%) ⬇️
appsec-express_fastify_graphql 68.97% <5.91%> (-0.36%) ⬇️
appsec-integration 50.40% <5.91%> (-0.17%) ⬇️
appsec-kafka_ldapjs_lodash 62.75% <5.91%> (-0.37%) ⬇️
appsec-mongodb-core_mongoose_mysql 66.49% <5.91%> (-0.36%) ⬇️
appsec-next ?
appsec-node-serialize_passport_postgres 66.12% <5.91%> (-0.40%) ⬇️
appsec-sourcing_stripe_template 64.52% <5.91%> (-0.36%) ⬇️
debugger 63.58% <5.91%> (-0.41%) ⬇️
instrumentations-bucket-0 50.86% <5.91%> (-0.35%) ⬇️
instrumentations-bucket-1 59.06% <5.91%> (-0.39%) ⬇️
instrumentations-bucket-10 60.90% <5.91%> (-0.37%) ⬇️
instrumentations-bucket-11 50.76% <5.91%> (-0.35%) ⬇️
instrumentations-bucket-12 51.36% <5.91%> (-0.34%) ⬇️
instrumentations-bucket-13 50.87% <5.91%> (-0.35%) ⬇️
instrumentations-bucket-2 52.74% <5.91%> (-0.34%) ⬇️
instrumentations-bucket-3 58.10% <5.91%> (-0.38%) ⬇️
instrumentations-bucket-4 51.40% <5.91%> (-0.35%) ⬇️
instrumentations-bucket-5 56.60% <5.91%> (-0.34%) ⬇️
instrumentations-bucket-6 59.56% <5.91%> (-0.40%) ⬇️
instrumentations-bucket-7 57.37% <5.91%> (-0.36%) ⬇️
instrumentations-bucket-8 58.45% <5.91%> (-0.38%) ⬇️
instrumentations-bucket-9 60.42% <5.91%> (-0.37%) ⬇️
instrumentations-instrumentation-couchbase 49.92% <4.67%> (-0.37%) ⬇️
instrumentations-integration-esbuild ?
llmobs-ai_anthropic_bedrock ?
llmobs-bucket-1 ?
llmobs-openai 61.14% <5.91%> (-0.36%) ⬇️
llmobs-openai-agents_vertex-ai ?
llmobs-sdk ?
openfeature ?
openfeature-unit ?
platform-core_esbuild_instrumentations-misc 40.44% <5.91%> (-0.15%) ⬇️
platform-integration ?
platform-shimmer_unit-guardrails_webpack ?
plugins-bucket-0 ?
plugins-bucket-1 ?
plugins-bucket-11 61.15% <5.91%> (-0.37%) ⬇️
plugins-bucket-18 60.85% <5.91%> (-0.37%) ⬇️
plugins-bucket-19 58.88% <5.91%> (-0.39%) ⬇️
plugins-bucket-20 60.88% <5.91%> (-0.39%) ⬇️
plugins-bucket-4 57.49% <5.91%> (-0.38%) ⬇️
plugins-bullmq_cassandra_cookie 60.54% <5.91%> (-0.40%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 55.64% <5.91%> (-0.39%) ⬇️
plugins-fetch_fs_generic-pool 57.75% <5.91%> (-0.34%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 63.42% <5.91%> (-0.40%) ⬇️
plugins-hapi_hono_ioredis ?
plugins-jest_knex_langgraph ?
plugins-ldapjs_light-my-request_limitd-client ?
plugins-lodash_mariadb_memcached ?
plugins-moleculer_mongodb_mongodb-core ?
plugins-mongoose_multer_mysql ?
plugins-mysql2_nats_node-serialize ?
plugins-opensearch_passport-http_pino ?
plugins-postgres_process_pug ?
plugins-redis_router_sequelize ?
plugins-test-and-upstream-rhea_undici_url ?
plugins-valkey_vm_winston ?
plugins-ws ?
profiling 60.98% <5.91%> (-0.39%) ⬇️
serverless-aws-sdk-aws-sdk ?
serverless-aws-sdk-base-inject-field ?
serverless-aws-sdk-bedrockruntime ?
serverless-aws-sdk-client ?
serverless-aws-sdk-dynamodb ?
serverless-aws-sdk-eventbridge ?
serverless-aws-sdk-kinesis 58.30% <5.91%> (-0.36%) ⬇️
serverless-aws-sdk-lambda ?
serverless-aws-sdk-s3 54.86% <5.91%> (-0.33%) ⬇️
serverless-aws-sdk-serverless-peer-service ?
serverless-aws-sdk-sns ?
serverless-aws-sdk-sqs 59.56% <5.91%> (-0.36%) ⬇️
serverless-aws-sdk-stepfunctions ?
serverless-aws-sdk-util ?
serverless-bucket-0 53.05% <4.67%> (-0.36%) ⬇️
serverless-bucket-1 58.17% <5.91%> (-0.37%) ⬇️
test-optimization-cucumber 70.81% <5.91%> (-0.38%) ⬇️
test-optimization-cypress ?
test-optimization-jest 72.19% <5.91%> (-0.37%) ⬇️
test-optimization-mocha 72.00% <5.91%> (-0.38%) ⬇️
test-optimization-playwright-playwright-atr 59.58% <5.91%> (-0.32%) ⬇️
test-optimization-playwright-playwright-efd 59.76% <5.91%> (-0.33%) ⬇️
test-optimization-playwright-playwright-final-status 59.88% <5.91%> (-0.33%) ⬇️
test-optimization-playwright-playwright-impacted-tests 59.46% <5.91%> (-0.32%) ⬇️
test-optimization-playwright-playwright-reporting 60.66% <5.91%> (-0.33%) ⬇️
test-optimization-playwright-playwright-test-management 60.25% <5.91%> (-0.33%) ⬇️
test-optimization-playwright-playwright-test-span 59.62% <5.91%> (-0.32%) ⬇️
test-optimization-selenium 59.22% <5.91%> (-0.30%) ⬇️
test-optimization-testopt 57.65% <5.91%> (-0.26%) ⬇️
test-optimization-vitest 69.67% <5.91%> (-0.39%) ⬇️
test-optimization-vitest-browser 58.42% <5.91%> (-0.29%) ⬇️
test-optimization-webdriverio 63.56% <5.91%> (-0.36%) ⬇️

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.

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