Skip to content

feat(telemetry): add gRPC transport for OTLP exporters - #266

Open
reyortiz3 wants to merge 8 commits into
mainfrom
feat/otlp-grpc-transport
Open

feat(telemetry): add gRPC transport for OTLP exporters#266
reyortiz3 wants to merge 8 commits into
mainfrom
feat/otlp-grpc-transport

Conversation

@reyortiz3

Copy link
Copy Markdown
Contributor

Summary

  • Adds gRPC as an alternative OTLP transport (alongside the existing HTTP/protobuf-only support) in telemetry/providers.
  • otlp.Config and providers.Config gain a Protocol field (http, the existing default, or grpc); the trace, metric, and log exporters each branch on it to build against otlptracegrpc / otlpmetricgrpc / otlploggrpc instead of the *http variants.
  • Adds a WithProtocol option to select the transport, and a signal-specific TracesProtocol override with WithTracesProtocol, for setups where traces need a different transport than metrics/logs (e.g. routing them to different destinations).

Motivation

A downstream consumer, ai-gateway in stacklok-enterprise-platform, needs to reach its existing in-cluster OTel Collector over gRPC and currently can't migrate onto this package without gRPC support — today telemetry/providers only supports OTLP/HTTP.

Verification

Ran on the feature branch before opening this PR:

task lint   # golangci-lint run --allow-parallel-runners ./... -> 0 issues; go vet ./... -> clean
task test   # go test -race ./... -> all packages pass
go build ./...   # clean

🤖 Generated with Claude Code

reyortiz3 and others added 8 commits September 2, 2026 15:53
Adds a Protocol field to otlp.Config and providers.Config (grpc alongside
the existing http/protobuf default) so trace, metric, and log exporters
can each be built against an OTLP/gRPC endpoint via
otlptracegrpc/otlpmetricgrpc/otlploggrpc, selected through the new
WithProtocol option.

A signal-specific TracesProtocol override (WithTracesProtocol) lets traces
use a different transport than metrics/logs, for setups that need to route
traces and metrics/logs to different destinations with different
transports.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
golang.org/x/crypto v0.55.0 (a pre-existing transitive dependency,
pulled in via golang.org/x/crypto/ssh) is affected by GO-2026-6354 and
GO-2026-6355, both fixed in v0.56.0. Bump the indirect requirement and
re-tidy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Resolve go.mod conflict: keep grpc as a direct dependency (used by
the new otlptracegrpc/otlpmetricgrpc/otlploggrpc exporters) while
taking main's newer golang.org/x/oauth2 v0.37.0 and
google.golang.org/grpc v1.83.2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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