Commit 1e2f4d4
authored
feat(llmobs): experiments multi-run (#4660)
<!--
* 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]>1 parent 7c0ac15 commit 1e2f4d4
6 files changed
Lines changed: 865 additions & 64 deletions
File tree
- internal/llmobs
- transport
- llmobs/experiment
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
729 | 731 | | |
730 | 732 | | |
731 | 733 | | |
732 | | - | |
733 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
734 | 751 | | |
735 | 752 | | |
736 | 753 | | |
737 | 754 | | |
738 | 755 | | |
739 | 756 | | |
740 | | - | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
741 | 766 | | |
742 | | - | |
| 767 | + | |
743 | 768 | | |
744 | 769 | | |
745 | | - | |
746 | | - | |
| 770 | + | |
| 771 | + | |
747 | 772 | | |
748 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
749 | 780 | | |
750 | 781 | | |
751 | 782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
264 | 316 | | |
265 | 317 | | |
266 | 318 | | |
| |||
2083 | 2135 | | |
2084 | 2136 | | |
2085 | 2137 | | |
2086 | | - | |
| 2138 | + | |
2087 | 2139 | | |
2088 | 2140 | | |
2089 | 2141 | | |
| |||
2110 | 2162 | | |
2111 | 2163 | | |
2112 | 2164 | | |
2113 | | - | |
| 2165 | + | |
2114 | 2166 | | |
2115 | 2167 | | |
2116 | 2168 | | |
| |||
2132 | 2184 | | |
2133 | 2185 | | |
2134 | 2186 | | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2135 | 2217 | | |
2136 | 2218 | | |
2137 | 2219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| |||
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| 165 | + | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
| |||
441 | 448 | | |
442 | 449 | | |
443 | 450 | | |
| 451 | + | |
444 | 452 | | |
445 | 453 | | |
446 | 454 | | |
| |||
461 | 469 | | |
462 | 470 | | |
463 | 471 | | |
| 472 | + | |
464 | 473 | | |
465 | 474 | | |
466 | 475 | | |
| |||
483 | 492 | | |
484 | 493 | | |
485 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
486 | 518 | | |
487 | 519 | | |
488 | 520 | | |
| |||
0 commit comments