Skip to content

feat(observability): OTLP exporter + collector docs#475

Merged
ALRubinger merged 1 commit intomainfrom
worktree-otel-otlp-exporter
May 6, 2026
Merged

feat(observability): OTLP exporter + collector docs#475
ALRubinger merged 1 commit intomainfrom
worktree-otel-otlp-exporter

Conversation

@ALRubinger
Copy link
Copy Markdown
Owner

Summary

Adds the production trace destination Aileron was missing. With AILERON_OTEL_EXPORTER=otlp, spans ship to an OpenTelemetry Collector via OTLP/HTTP — the path that fans out to Grafana / Datadog / Honeycomb / Jaeger / Tempo / etc. without bespoke integration.

Closes the "configurable endpoint" goal of #390 (the issue itself was closed earlier; this completes the production deployment story it described).

Why HTTP, why no Aileron prefix

  • OTLP/HTTP over gRPC — keeps the dep tree light and plays nicely with proxies. The SDK ships both; HTTP is the lower-friction default for self-hosters.
  • Honors OTEL_EXPORTER_OTLP_* directly — no Aileron-prefixed alternatives. Anyone running an OTel collector already has these env vars in their environment; forking the names would force them to maintain two parallel sets.

Usage

Local dev:

docker run --rm -p 4318:4318 otel/opentelemetry-collector-contrib:latest

AILERON_OTEL_ENABLED=true \
AILERON_OTEL_EXPORTER=otlp \
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 \
OTEL_EXPORTER_OTLP_INSECURE=true \
aileron launch claude

Managed backends use OTEL_EXPORTER_OTLP_HEADERS for auth — Honeycomb, Grafana Cloud, Datadog all show concrete examples in the docs.

Docs restructure

This PR also restructures the Observability guide:

  1. New "What is OpenTelemetry?" top-level section above the audit log, so readers without prior OTel familiarity get oriented before either surface is described. Defines OTel, traces/spans, OTLP, OTel endpoints, and the collector-fan-out value prop.
  2. New "Hooking up to a collector" subsection with concrete docker run example for local dev plus Honeycomb and Grafana Cloud production examples.
  3. Configuration table updated with the OTLP row and the standard OTEL_EXPORTER_OTLP_* env vars (headers, insecure, etc.) so users have everything in one reference.

Test plan

  • TestOTLPExporter_PostsToCollectorEndpoint — full round-trip against an httptest server impersonating an OTLP/HTTP collector; asserts POST to /v1/traces with application/x-protobuf body
  • TestNewExporter_DispatchesOTLPByConfig — config dispatch wiring
  • TestLoadObservabilityConfig_AcceptsOTLPExporter — config parsing
  • Coverage: internal/observability 90.7%, internal/config 96.1%
  • go test ./... — full internal-module sweep green
  • All four cmd/* modules build cleanly
  • task build:docs — 55 pages, no errors

🤖 Generated with Claude Code

Adds the production trace destination Aileron was missing. With
AILERON_OTEL_EXPORTER=otlp, spans ship to an OpenTelemetry Collector
via OTLP/HTTP — the path that fans out to Grafana / Datadog /
Honeycomb / Jaeger / Tempo / etc. without bespoke integration.

The exporter honors the standard OTEL_EXPORTER_OTLP_* env vars
(ENDPOINT, HEADERS, INSECURE, TIMEOUT) directly via the OTel SDK.
No Aileron-prefixed alternatives — anyone running an OTel collector
already has these in their environment, and forking the names would
force them to maintain two parallel sets.

Implementation: ~10 lines added to internal/observability/tracing.go's
newExporter switch. otlptracehttp (HTTP/protobuf) over otlptracegrpc
to keep the dep tree light and play nicely with proxies. Initial
construction is lazy — connection failures surface on first
ExportSpans, which the SDK retries; daemon startup never blocks on
collector reachability.

Tests:
- TestNewExporter_DispatchesOTLPByConfig — dispatch wiring
- TestOTLPExporter_PostsToCollectorEndpoint — full round-trip
  against an httptest server impersonating an OTLP collector;
  asserts POST to /v1/traces with application/x-protobuf body
- TestLoadObservabilityConfig_AcceptsOTLPExporter — config parsing

Coverage: internal/observability 90.7%, internal/config 96.1%.

Docs:
- New top-level "What is OpenTelemetry?" section above the audit
  log so readers without prior OTel familiarity get oriented
  before either surface is described. Defines OTel, traces/spans,
  OTLP, OTel endpoints, and the collector-fan-out value prop.
- New "Hooking up to a collector" subsection with three concrete
  examples: local dev (docker run otel/opentelemetry-collector-
  contrib), Honeycomb, Grafana Cloud. Names the OTEL_EXPORTER_OTLP_*
  env vars users need to know.
- Configuration table updated with OTLP row and the standard env
  vars.

Closes the original "configurable endpoint" goal of #390 — the
issue itself was already closed but this completes the production
deployment story it described.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@railway-app
Copy link
Copy Markdown

railway-app Bot commented May 6, 2026

🚅 Deployed to the aileron-pr-475 environment in aileron

Service Status Web Updated (UTC)
docs ✅ Success (View Logs) Web May 6, 2026 at 7:19 am

@railway-app railway-app Bot temporarily deployed to aileron / aileron-pr-475 May 6, 2026 07:16 Destroyed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.10%. Comparing base (7987efa) to head (162d7f2).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #475      +/-   ##
==========================================
+ Coverage   82.24%   83.10%   +0.85%     
==========================================
  Files         234      234              
  Lines       24127    24129       +2     
==========================================
+ Hits        19843    20052     +209     
+ Misses       3148     2924     -224     
- Partials     1136     1153      +17     
Flag Coverage Δ
integration 15.62% <20.00%> (+7.17%) ⬆️
unit 78.90% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ALRubinger ALRubinger merged commit 0379aaf into main May 6, 2026
16 of 17 checks passed
@ALRubinger ALRubinger deleted the worktree-otel-otlp-exporter branch May 6, 2026 18:57
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