Commit 197726b
committed
Shut down the OTel SDK between collector-mode specs
The collector-mode shared context boots a full OTel SDK per example
via `start_agent` and never shut it down, leaking the batch span,
periodic metric reader and batch log processor threads (~460 live
threads by the end of a -collector CI run). The batch span thread was
doubly stranded: the context swaps in an in-memory tracer provider for
assertions, orphaning the booted one.
Shut the booted tracer provider down before the swap, and shut the
meter and logger providers down in an after hook. The after hook calls
`Appsignal::OpenTelemetry.shutdown` directly rather than
`Appsignal.stop`: stop's `Extension.stop` takes ~2 seconds per call,
which across every collector-mode example adds minutes to the suite.
[skip changeset]1 parent bbb6aac commit 197726b
1 file changed
Lines changed: 17 additions & 3 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
| |||
0 commit comments