Skip to content

feat!: make third-party OpenTelemetry instrumentation opt-in - #1146

Open
alexluong wants to merge 2 commits into
mainfrom
feat/otel-instrumentation-opt-in
Open

alexluong wants to merge 2 commits into
mainfrom
feat/otel-instrumentation-opt-in

Conversation

@alexluong

@alexluong alexluong commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

With OpenTelemetry enabled, Outpost also exported telemetry from its dependencies: a span for every Redis command, spans and a latency histogram from the message queue clients, and gRPC spans and metrics from the Google Pub/Sub clients. Third-party instrumentation is now off by default; OTEL_ENABLED_INSTRUMENTATIONS turns it back on per source. Outpost's own metrics, spans and audit logs and the HTTP server spans are unchanged.

Breaking: upgrading an install with OpenTelemetry enabled

Without OTEL_SERVICE_NAME set, nothing changes.

source before after, default to keep it
Outpost metrics, spans, audit logs exported exported n/a
HTTP server spans (otelgin) exported exported n/a
Redis command spans exported not exported redis
Internal message queue client: gocloud.dev spans + gocloud.dev/pubsub/latency, GCP Pub/Sub gRPC spans and metrics exported not exported mq
GCP Pub/Sub destination gRPC spans and metrics exported not exported can't be turned back on

To keep today's output:

OTEL_ENABLED_INSTRUMENTATIONS=redis,mq

Changes

  1. SetupOTelSDK wraps the global tracer and meter providers in a filter on instrumentation scope (internal/otel/instrumentation.go). A dropped scope gets a noop meter and a tracer that records nothing and passes the parent span context through, so spans below a dropped span keep the right parent. Filtering at the provider covers gocloud.dev, which has no option to turn its instrumentation off.
  2. New config key OTEL_ENABLED_INSTRUMENTATIONS (redis, mq); an unknown value fails config validation when OpenTelemetry is enabled.
  3. The GCP Pub/Sub destination client sets option.WithTelemetryDisabled(). Its gRPC telemetry has the same scope as the internal queue's, so it can't get its own key.

Note: mq matches the otelgrpc scope, so a Google gRPC client added later follows the mq key unless it disables its own telemetry.

🤖 Generated with Claude Code

@alexluong alexluong changed the title feat: make third-party OpenTelemetry instrumentation opt-in feat!: make third-party OpenTelemetry instrumentation opt-in Oct 12, 2026

This branch has not been deployed

No deployments
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.

2 participants