Skip to content

feat(otel): first-class OpenTelemetry export — traces, otelite CI gate, o11y VRS tree - #347

Merged
schickling-assistant merged 9 commits into
mainfrom
schickling/2026-08-25-otel
Aug 26, 2026
Merged

feat(otel): first-class OpenTelemetry export — traces, otelite CI gate, o11y VRS tree#347
schickling-assistant merged 9 commits into
mainfrom
schickling/2026-08-25-otel

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

What

First-class OpenTelemetry support for st2 — PR 1 of the agreed all-signals stack.

  • src/telemetry.rs — OTLP/HTTP JSON exporter behind OTEL_EXPORTER_OTLP_ENDPOINT, hard no-op when unset; service.name=st2-{supervisor,cli}, service.version from the build stamp, host.name.
  • src/run.rsst2.reconcile_pass root span per supervisor pass and up_once, attrs st2.host, st2.crash_loops, st2.unparked.
  • src/service.rs — captured ambient OTEL_* env serialized into systemd-user unit Environment= lines (injectable + unit-tested).
  • tests/otel_export.rs + new checks.otel-export flake gate — end-to-end proof: real st2 up --once exports spans into an otelite receiver (effect-utils flake package); gate is non-vacuous in CI.
  • docs/vrs/06-observability/ — requirements/spec/decisions/experiment evidence for the o11y subsystem (axe vrs check --profile strict: 0 findings).

Notes for reviewers

  • Crate pin: opentelemetry-otlp = { default-features = false, features = ["http-json", "reqwest-blocking-client", "internal-logs"] }. Enabling both reqwest client features compiles but fails at runtime with NoHttpClient; the blocking client is required because st2 has no tokio reactor.
  • New flake input effect-utils (github:overengineeringstudio/effect-utils/main) brings the otelite package output; no follows, mirroring how pty stays self-contained.

Verification

  • nix build .#checks.x86_64-linux.otel-export passes (~110s) in the sandbox: real binary → real OTLP export → otelite assertions.
  • Full workspace suite green except agent_publish/eval_up/doctor failures that reproduce identically on clean HEAD (pre-existing, environment-dependent).
  • axe vrs check --profile strict .: 0 findings under docs/vrs/06-observability/**.

Follow-ups (tracked in docs/vrs/06-observability)

  • PR 2: metrics. PR 3: log bridge (per decision 0001).
  • st2 up <spec> path not yet instrumented; remaining provenance resource attrs deferred.
  • Central-contract obligations (telemetry.contract.ts registry entry, dashboards, coverage census) are dotfiles-side follow-up.
Posted on behalf of @schickling
field value
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

@schickling-assistant

Copy link
Copy Markdown
Contributor Author

@codex Please review — PR 1 of the otel stack: OTLP/HTTP-JSON trace export behind OTEL_EXPORTER_OTLP_ENDPOINT (hard no-op when unset), st2.reconcile_pass spans, systemd OTEL_* env propagation, new checks.otel-export flake gate (otelite receiver, non-vacuous), and the docs/vrs/06-observability VRS tree.

Fleet e2e already proven: real traces queryable in Grafana via gcx (trace 53b21f66c5f00de44e88c745cdb6d781, full Alloy→Tempo→Grafana path).

Also includes a CI timeout bump 30m→90m (nix.yml) — the check set grew with the otel gate.

Posted on behalf of @schickling
field value
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

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93c5bf09c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/run.rs Outdated
Comment thread tests/otel_export.rs Outdated
Comment thread src/run.rs Outdated
…e, o11y VRS tree

- src/telemetry.rs: OTLP/HTTP JSON exporter behind OTEL_EXPORTER_OTLP_ENDPOINT,
  hard no-op when unset; service.name per process unit (st2-supervisor/st2-cli),
  service.version from the build stamp, host.name from detect_host.
- run.rs: st2.reconcile_pass root span per supervisor pass and up_once with
  st2.host/st2.crash_loops/st2.unparked attributes.
- service.rs: captured ambient OTEL_* vars serialize into systemd Environment=
  lines (injectable, unit-tested).
- tests/otel_export.rs + checks.otel-export: end-to-end proof exporting real
  st2 spans into an otelite receiver (effect-utils flake package); gate is
  non-vacuous (no skip escape in CI).
- docs/vrs/06-observability/: requirements, spec, decisions, experiment
  evidence for the all-signals PR stack (metrics and log bridge follow).

opentelemetry-otlp pinned to http-json + reqwest-blocking-client: enabling both
reqwest client features compiles but fails at runtime with NoHttpClient.

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
…om interview

Q5: RED-minimal metric set, bounded-enum labels only.
Q6: tracing facade for logs (tracing-opentelemetry + appender).
R04 attrs and unit env mechanism closed by evidence.

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
nix flake check now also builds the st2-otel-export gate; the 30m budget
was cancelled mid-build on contended shared runners.

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
…nner deadline in e2e

- Add process-wide ENABLED gate + PassSpan guard in telemetry; all three
  reconcile-pass sites (up_once, supervisor loop, newly instrumented
  up_once_selected) now construct nothing when OTEL_EXPORTER_OTLP_ENDPOINT
  is unset instead of allocating a no-op tracer/attrs per pass.
- tests/otel_export.rs: read otelite stdout on a reader thread feeding an
  mpsc channel so the 10s banner deadline is enforced with recv_timeout
  instead of a blocking read that can hang the CI workflow.

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
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
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
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
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
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
@schickling-assistant
schickling-assistant force-pushed the schickling/2026-08-25-otel branch from b1d2b63 to 539427b Compare August 26, 2026 19:17
@schickling-assistant
schickling-assistant merged commit 14ad22c into main Aug 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant