feat(api-server): add OpenTelemetry instrumentation for HTTP and gRPC - #141
Draft
JuanmaBM wants to merge 1 commit into
Draft
feat(api-server): add OpenTelemetry instrumentation for HTTP and gRPC#141JuanmaBM wants to merge 1 commit into
JuanmaBM wants to merge 1 commit into
Conversation
Add OTel tracing and metrics to the API server via a new plugin that registers HTTP middleware and gRPC interceptors through the framework's pre-auth hooks. Instrumentation is opt-in: when OTEL_EXPORTER_OTLP_ENDPOINT is unset the plugin is a no-op with zero overhead. - OTel SDK init with TracerProvider + MeterProvider (OTLP gRPC exporters) - HTTP middleware via otelhttp with W3C Trace Context propagation - gRPC unary + streaming interceptors with semantic convention attributes - Graceful shutdown flushes buffered telemetry on SIGTERM - Jaeger all-in-one manifest for Kind (KIND_JAEGER=true) - Spec: specs/platform/api-server-observability.spec.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
plugins/otelplugin that registers HTTP middleware (otelhttp) and gRPC interceptors through the framework's pre-auth hooksOTEL_EXPORTER_OTLP_ENDPOINTis unset the plugin is a no-op with zero overheadKIND_JAEGER=truespecs/platform/api-server-observability.spec.mdWhat's included
plugins/otel/plugin.gocmd/hypershell/main.godeploy/kind/jaeger.yamlscripts/kind/up.shKIND_JAEGER=truespecs/platform/api-server-observability.spec.mdspecs/index.spec.mdspecs/platform/local-development.spec.mdKIND_JAEGERandJAEGER_VERSIONenv varsEnvironment Variables
OTEL_EXPORTER_OTLP_ENDPOINTOTEL_TRACES_SAMPLER_ARG1.0OTEL_SERVICE_NAMEhypershell-api-serverKIND_JAEGERtrueto deploy Jaeger in KindJAEGER_VERSION2.6Test plan
go build ./...andgo vet ./...pass (verified)KIND_JAEGER=true make kind-upOTEL_EXPORTER_OTLP_ENDPOINTis unset🤖 Generated with Claude Code