You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Select the OTLP transport from OTEL_EXPORTER_OTLP_PROTOCOL / OTEL_EXPORTER_OTLP_TRACES_PROTOCOL in initTraceExporter (pkg/common/observability/tracing/telemetry.go), and add an otlptracehttp path alongside the existing otlptracegrpc one.
otlptracegrpc.New is the only exporter constructed today. No OTLP exporter package reads the protocol variable - protocol selection is the caller's job - so http/protobuf currently has no effect and spans still go over gRPC to port 4317, against a backend that may only serve 4318.
Three implementation notes:
This adds a module.go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp is not in go.sum. It is a new direct dependency at the same version as the gRPC exporter (v1.44.0) and from the same release train as the modules already required, so it adds no new transitive versions, but it needs agreement before the work starts.
http/json is out of scope. The Go SDK ships no JSON encoder for OTLP; only grpc and http/protobuf are implementable. http/json should reach the error handler as unsupported rather than falling back silently.
The loopback fallback becomes protocol-dependent.localCollectorOptions pins localhost:4317 and plaintext when no transport variable is set. The HTTP exporter defaults to 4318, so the fallback has to select per protocol, and the option types (otlptracegrpc.Option and otlptracehttp.Option) are distinct, so one helper cannot serve both as currently written.
Why is this needed:
OTLP/HTTP is the transport many managed backends and ingress paths expose, and some environments terminate gRPC at the edge or disallow HTTP/2 to the collector. With gRPC as the only path, those deployments cannot export at all. The protocol variable is read by nothing: an operator sets OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf, sees no error, and gets no spans.
Acceptance criteria:
http/protobuf exports over OTLP/HTTP; grpc and unset both export over gRPC.
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL takes precedence over OTEL_EXPORTER_OTLP_PROTOCOL.
An unsupported protocol value is reported through the error handler.
What would you like to be added:
Select the OTLP transport from
OTEL_EXPORTER_OTLP_PROTOCOL/OTEL_EXPORTER_OTLP_TRACES_PROTOCOLininitTraceExporter(pkg/common/observability/tracing/telemetry.go), and add anotlptracehttppath alongside the existingotlptracegrpcone.otlptracegrpc.Newis the only exporter constructed today. No OTLP exporter package reads the protocol variable - protocol selection is the caller's job - sohttp/protobufcurrently has no effect and spans still go over gRPC to port 4317, against a backend that may only serve 4318.Three implementation notes:
This adds a module.
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttpis not ingo.sum. It is a new direct dependency at the same version as the gRPC exporter (v1.44.0) and from the same release train as the modules already required, so it adds no new transitive versions, but it needs agreement before the work starts.http/jsonis out of scope. The Go SDK ships no JSON encoder for OTLP; onlygrpcandhttp/protobufare implementable.http/jsonshould reach the error handler as unsupported rather than falling back silently.The loopback fallback becomes protocol-dependent.
localCollectorOptionspinslocalhost:4317and plaintext when no transport variable is set. The HTTP exporter defaults to 4318, so the fallback has to select per protocol, and the option types (otlptracegrpc.Optionandotlptracehttp.Option) are distinct, so one helper cannot serve both as currently written.Why is this needed:
OTLP/HTTP is the transport many managed backends and ingress paths expose, and some environments terminate gRPC at the edge or disallow HTTP/2 to the collector. With gRPC as the only path, those deployments cannot export at all. The protocol variable is read by nothing: an operator sets
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf, sees no error, and gets no spans.Acceptance criteria:
http/protobufexports over OTLP/HTTP;grpcand unset both export over gRPC.OTEL_EXPORTER_OTLP_TRACES_PROTOCOLtakes precedence overOTEL_EXPORTER_OTLP_PROTOCOL.telemetry_otlp_test.go.Part of #1632.