Skip to content

feat(llmobs): experiments multi-run#4660

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
mainfrom
rarguelloF/experiment-multi-run
Apr 22, 2026
Merged

feat(llmobs): experiments multi-run#4660
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
mainfrom
rarguelloF/experiment-multi-run

Conversation

@rarguelloF

@rarguelloF rarguelloF commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Motivation

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running make lint locally.
  • New code doesn't break existing tests. You can check this by running make test locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.

Unsure? Have a question? Request a review!

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Apr 14, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 74.36%
Overall Coverage: 61.09% (+0.97%)

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

@pr-commenter

pr-commenter Bot commented Apr 14, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-21 16:28:29

Comparing candidate commit 5dfaa87 in PR branch rarguelloF/experiment-multi-run with baseline commit 7d2d814 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 215 metrics, 9 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 ----------------------------------'

@rarguelloF
rarguelloF marked this pull request as ready for review April 15, 2026 09:50
@rarguelloF
rarguelloF requested review from a team as code owners April 15, 2026 09:50

@gary-huang gary-huang left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM! A question though, the run ID and run iteration tags are not propagated across distributed boundaries, right?

@rarguelloF

Copy link
Copy Markdown
Contributor Author

A question though, the run ID and run iteration tags are not propagated across distributed boundaries, right?

nice catch! added it here 5dfaa87

@codecov

codecov Bot commented Apr 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.15385% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.77%. Comparing base (7d2d814) to head (5dfaa87).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
internal/llmobs/transport/dne.go 0.00% 17 Missing ⚠️
llmobs/experiment/experiment.go 86.81% 6 Missing and 6 partials ⚠️
internal/llmobs/llmobs.go 88.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
llmobs/experiment/option.go 100.00% <100.00%> (+8.33%) ⬆️
internal/llmobs/llmobs.go 78.92% <88.23%> (-5.90%) ⬇️
llmobs/experiment/experiment.go 84.41% <86.81%> (+16.32%) ⬆️
internal/llmobs/transport/dne.go 0.00% <0.00%> (ø)

... and 282 files with indirect coverage changes

🚀 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.

@rarguelloF

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Apr 22, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-04-22 08:30:57 UTC ℹ️ Start processing command /merge


2026-04-22 08:31:02 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 15m (p90).


2026-04-22 08:45:06 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 1e2f4d4 into main Apr 22, 2026
189 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the rarguelloF/experiment-multi-run branch April 22, 2026 08:45
darccio pushed a commit that referenced this pull request Apr 24, 2026
<!--
* New contributors are highly encouraged to read our
  [CONTRIBUTING](/CONTRIBUTING.md) documentation.
* Commit and PR titles should be prefixed with the general area of the pull request's change.

-->
### What does this PR do?

<!--
* A brief description of the change being made with this pull request.
* If the description here cannot be expressed in a succinct form, consider
  opening multiple pull requests instead of a single one.
-->

- Adds `llmobs/experiment.WithRuns(n)` option to enable multiple runs (https://docs.datadoghq.com/llm_observability/experiments/advanced_runs/#multiple-runs).
- Implements experiment lifecycle status, so now the backend is notified of the experiment's state throughout execution: running when it starts, completed or failed when it finishes (based on whether any errors occurred), and interrupted if the context is cancelled before completion.
- Propagate `experiment_id`, `run_id`, and `run_iteration` across distributed boundaries via APM baggage keys. Any LLMObs span started in a downstream service automatically inherits these fields as tags and gets scope=experiments.

### Motivation

<!--
* What inspired you to submit this pull request?
* Link any related GitHub issues or PRs here.
* If this resolves a GitHub issue, include "Fixes #XXXX" to link the issue and auto-close it on merge.
-->

### Reviewer's Checklist
<!--
* Authors can use this list as a reference to ensure that there are no problems
  during the review but the signing off is to be done by the reviewer(s).
-->

- [x] Changed code has unit tests for its functionality at or near 100% coverage.
- [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag.
- [ ] There is a benchmark for any new code, or changes to existing code.
- [ ] If this interacts with the agent in a new way, a system test has been added.
- [ ] New code is free of linting errors. You can check this by running `make lint` locally.
- [ ] New code doesn't break existing tests. You can check this by running `make test` locally.
- [ ] Add an appropriate team label so this PR gets put in the right place for the release notes.
- [ ] All generated files are up to date. You can check this by running `make generate` locally.
- [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally.

Unsure? Have a question? Request a review!


Co-authored-by: rodrigo.arguello <[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.

2 participants