Commit d87feaa
authored
* observability: PR #19 round-7 review followups
- Guard cross-context detach in _handle_completed and
_handle_llm_event so out-of-LIFO completion under concurrent
fan-out doesn't crash the runtime (proper fix in Phase 6.1).
- Add call_id (UUIDv4) on _LlmEventState so concurrent LLM
calls don't collide on the constant LLM-namespace key in
_open_llm_spans.
- Switch importorskip target to opentelemetry.sdk.trace in
both observability test modules so a partial install (API
but no SDK) skips cleanly instead of erroring at collection.
- Drain leaf spans, LLM spans, detached roots, and synthetic
subgraph dispatch spans on OTelObserver.shutdown() — now
matches the docstring contract regardless of where the
invocation ended.
- Snapshot + restore root logger handlers/filters in
test_install_log_bridge_is_idempotent so it doesn't leak
state into other tests.
* otel: address PR #20 review
- Add inline comment in _drain_open_span's except ValueError so
CodeQL/code-quality stop flagging the bare swallow. Matches the
existing pattern at the four other cross-context-detach sites.
- Fix shutdown() ordering. The docstring promised child->parent
closure but iterating `list(map.keys())` follows insertion
order (parents first), so children outlived their parents in
traces. Now drains _open_llm_spans (deepest leaves) before
_open_spans; sorts the depth-bearing maps (_open_spans,
_detached_roots, _subgraph_spans) by -len(namespace) so deeper
entries close first. _open_llm_spans (call_id keys) and
_invocation_span (one entry per cid) need no within-map sort.
1 parent 3805e4f commit d87feaa
4 files changed
Lines changed: 120 additions & 23 deletions
File tree
- src/openarmature
- llm/providers
- observability/otel
- tests
- conformance
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
206 | 214 | | |
| 215 | + | |
207 | 216 | | |
208 | | - | |
| 217 | + | |
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
212 | 221 | | |
213 | 222 | | |
214 | | - | |
| 223 | + | |
215 | 224 | | |
216 | 225 | | |
217 | 226 | | |
218 | 227 | | |
219 | 228 | | |
220 | 229 | | |
| 230 | + | |
221 | 231 | | |
222 | 232 | | |
223 | 233 | | |
| |||
537 | 547 | | |
538 | 548 | | |
539 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
540 | 557 | | |
541 | 558 | | |
| 559 | + | |
542 | 560 | | |
543 | 561 | | |
544 | 562 | | |
| |||
558 | 576 | | |
559 | 577 | | |
560 | 578 | | |
| 579 | + | |
561 | 580 | | |
562 | 581 | | |
563 | 582 | | |
| |||
569 | 588 | | |
570 | 589 | | |
571 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
572 | 594 | | |
573 | 595 | | |
574 | 596 | | |
| |||
580 | 602 | | |
581 | 603 | | |
582 | 604 | | |
| 605 | + | |
583 | 606 | | |
584 | 607 | | |
585 | 608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
184 | 194 | | |
185 | 195 | | |
186 | 196 | | |
| |||
306 | 316 | | |
307 | 317 | | |
308 | 318 | | |
309 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
310 | 332 | | |
311 | 333 | | |
312 | 334 | | |
| |||
371 | 393 | | |
372 | 394 | | |
373 | 395 | | |
374 | | - | |
| 396 | + | |
375 | 397 | | |
376 | | - | |
| 398 | + | |
377 | 399 | | |
378 | 400 | | |
379 | 401 | | |
| |||
397 | 419 | | |
398 | 420 | | |
399 | 421 | | |
400 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
401 | 432 | | |
402 | 433 | | |
403 | 434 | | |
| |||
432 | 463 | | |
433 | 464 | | |
434 | 465 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | 466 | | |
441 | 467 | | |
442 | 468 | | |
| |||
718 | 744 | | |
719 | 745 | | |
720 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
721 | 765 | | |
722 | 766 | | |
723 | 767 | | |
| |||
782 | 826 | | |
783 | 827 | | |
784 | 828 | | |
785 | | - | |
786 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
787 | 851 | | |
788 | 852 | | |
789 | 853 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
0 commit comments