ops: make OTLP telemetry export opt-in so a small-box deploy needs no collector #155
Labels
No labels
kind
bug
kind
enhancement
wayfinder
grilling
wayfinder
map
wayfinder
prototype
wayfinder
research
wayfinder
task
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rosa/vernier#155
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during a pre-production review.
Location:
crates/server/src/main.rs:217(init_telemetry), exporter built atmain.rs:222Severity: Operability friction — conflicts with "small box" goal
Problem
init_telemetryunconditionally builds an OTLP span exporter and installs a batch exporter (main.rs:222–233). With noOTEL_EXPORTER_OTLP_ENDPOINTset, the OTLP HTTP exporter defaults tohttp://localhost:4318. A self-hoster who just wants a blog and runs no collector therefore gets a batch exporter that fails to export on every flush — recurring error/warN noise — and is effectively required to stand up a Jaeger/OTLP collector for a plain deployment.This runs against ARCHITECTURE.md Goal #1 ("runs on a small box... little upkeep"): tracing export should be something you opt into, not mandatory boot wiring.
Suggested fix
Make OTLP export conditional on configuration:
OTEL_EXPORTER_OTLP_ENDPOINTis present, or aVERNIER_-prefixed setting).fmt+EnvFilterlayers alone so structured logging still works with zero external dependencies.Keep the exporter path exactly as-is when an endpoint is configured — this is purely about not requiring a collector for the default single-box deployment.
Agent Brief
Category: bug
Summary: Only initialize the OTLP span exporter when an export endpoint is configured; otherwise run local logging alone, so a default single-box deploy needs no collector.
Current behavior:
Telemetry initialization at the composition root unconditionally builds an OTLP HTTP span exporter and installs it as a batch exporter alongside the
fmtandEnvFilterlogging layers. With no OTLP endpoint configured, the exporter defaults tohttp://localhost:4318; an operator who runs no collector gets a batch exporter that fails to export on every flush (recurring error/warn noise) and is effectively forced to stand up a collector for an ordinary deployment. This works against the "runs on a small box, little upkeep" goal.Desired behavior:
OTLP export is opt-in. When an export endpoint is configured, behavior is exactly as today — the OTLP batch exporter is installed and spans are exported. When it is not configured, telemetry initializes with local logging only (
fmt+EnvFilter), no OTLP exporter is built, and there is no export-failure noise. Detect the opt-in via the standardOTEL_EXPORTER_OTLP_ENDPOINTenvironment variable (present/non-empty = enabled); this keeps it consistent with the wider OpenTelemetry ecosystem and does not require adding a field to the typedConfig.VERNIER_LOGcontinues to drive the filter in both modes.Key interfaces:
Option, or a no-op shutdown handle). Preserve clean shutdown: the enabled path must still flush buffered spans on exit; the disabled path has nothing to flush.fmtandEnvFilterlayers are always present.Acceptance criteria:
OTEL_EXPORTER_OTLP_ENDPOINTunset, the server starts, logs to stdout viafmt/EnvFilter, builds no OTLP exporter, and emits no export-failure errors.OTEL_EXPORTER_OTLP_ENDPOINTset, spans are exported over OTLP exactly as before.VERNIER_LOGcontrols the filter in both modes.Out of scope:
Config(env detection is sufficient).