Commit 19485cf
authored
feat(otel): tracing facade — unified span+log subscriber, diagnostics migration, log CI assertions (#350)
* feat(otel): tracing facade — unified span+log subscriber, diagnostics migration, log CI assertions
PR3 per interview decision Q6 (docs/vrs/06-observability/open-questions.md):
- Telemetry::init now installs one tracing subscriber: a stderr fmt layer
runs unconditionally so migrated diagnostics stay visible with or without
an endpoint (documented deviation from PR1's zero-output unset case;
RUST_LOG overrides the INFO default), plus — behind the endpoint guard —
a tracing-opentelemetry span layer and an opentelemetry-appender-tracing
bridge over a new SDK logger provider sharing endpoint/protocol/resource.
experimental_use_tracing_span_context stamps active span ids onto records.
shutdown flushes logger+meter+tracer together.
- st2.reconcile_pass spans move to tracing::info_span! at all three sites
(up_once, up_loop_until pass, reconcile_pass_specs_with_sessions); names
and st2.host/st2.crash_loops/st2.unparked attributes unchanged; metric
recording calls untouched. Each pass emits a deterministic INFO record
(target st2, "reconcile pass complete", result=pass|fail).
- Non-user-facing eprintln! diagnostics migrate to tracing::warn!/error!
with unchanged text: crash-loop give-ups and supervisor notification,
park-channel setup, catalog watching, ding transport ambiguity, driver
session degradation, harness-state floor writes. CLI command output,
boot banners, and validation reports stay println!/eprintln!.
- tests/otel_export.rs additionally asserts logs.ndjson carries the
completion record (body/severity) correlated to the captured
st2.reconcile_pass span via trace/span ids; existing span+metric
assertions unchanged.
agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@929dc21
* fix(otel): scope RUST_LOG to stderr layer; make metric setup best-effort
Two review findings on the log-bridge PR:
1. The EnvFilter was attached to the base subscriber, so RUST_LOG=warn
silently disabled INFO span/log export even with an endpoint set.
The stderr fmt layer now carries the filter alone. The OpenTelemetry
layers carry their own static filter, independent of RUST_LOG, that
silences only exporter-internal targets (opentelemetry*): the SDK's
BatchLogProcessor emits tracing events from inside its own emit(),
and feeding those back through the unfiltered log bridge recursed
until the export thread overflowed its stack (gdb-proven). App
signals export unfiltered.
2. A metric exporter build failure early-returned before logger setup,
killing logs along with metrics. Metric setup is now best-effort:
warn and continue to the logger provider.
agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@929dc21
* fix(otel): keep piped stderr diagnostics plain — fmt layer ansi follows tty
tracing_subscriber's fmt layer enables ANSI whenever the 'ansi' feature is on, regardless of destination, so redirected stderr carried SGR escapes where the pre-migration eprintln! path emitted plain bytes. Gate the layer on std::io::stderr().is_terminal().
agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@929dc21
* fix(otel): emit one correlated signal set and shut providers down cleanly
agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@e4789b0
* feat(otel): add semantic reconciliation trace hierarchy
agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@e4789b01 parent af4881e commit 19485cf
22 files changed
Lines changed: 1497 additions & 358 deletions
File tree
- docs/vrs/06-observability
- .decisions
- .experiments
- src
- ding
- tests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
Lines changed: 15 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
22 | 36 | | |
23 | 37 | | |
24 | 38 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
27 | 43 | | |
28 | 44 | | |
29 | 45 | | |
| |||
0 commit comments