otlp*http modules import grpc
Author: MadVikingGodCreated Feb 3, 2022Updated Sep 18, 2026
Labelsbugarea:metricsarea:tracearea:logspkg:exporter:otlp
Description
This was surfaced in the discussion:https://github.com/open-telemetry/opentelemetry-go/discussions/2509
The otlptracehttp client and otlptrace depend on grpc. This is a transitive dependency from internal/otlpconfig. This is counter to why we split these packages into separate mods in the first place.
Environment
- OS: [e.g. iOS]
- Architecture: [e.g. x86, i386]
- Go Version: [e.g. 1.15]
- opentelemetry-go version: [e.g. v0.14.0, 3c7face]
Steps To Reproduce
cd exporters/otlp/otlptrace/otlptracehttpgo mod graph | grep grpcthis should be emptygo mod why google.golang.org/grpcthis should report that module does not need grpc.
Expected behavior
The HTTP client should not depend on grpc.
Aditional information
otlpconfig has a config struct that is shared between HTTP client and grpc. This has logic around extracting the variables from the environment. Because the config has settings for grpc this means importing otlpconfig will import grpc (even if they are later pruned).
Source: open-telemetry/opentelemetry-go