open-telemetry / open-telemetry/opentelemetry-cpp-contrib
Add HTTP/protobuf OTLP export support to otel-webserver-module
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 153
- Forks
- 184
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 26
Description
Summary
Add support for HTTP/protobuf OTLP export protocol alongside the existing gRPC export in the otel-webserver-module (used for Apache HTTPD and Nginx auto-instrumentation).
Motivation
The OpenTelemetry Operator provides auto-instrumentation for multiple languages (Java, Python, Node.js, .NET, Go). All other language auto-instrumentations support configuring the OTLP export protocol via the OTEL_EXPORTER_OTLP_PROTOCOL environment variable, and default to http/protobuf. The Apache HTTPD and Nginx auto-instrumentations are the exception — they hardcode gRPC at the native C++ level by directly linking libopentelemetry_exporter_otlp_grpc.so.
This creates operational friction:
- Users must ensure their collector exposes the gRPC endpoint (port 4317) specifically for these two instrumentations, even if everything else in their environment uses HTTP/protobuf (port 4318)
- The
OTEL_EXPORTER_OTLP_PROTOCOLenvironment variable is silently ignored, leading to confusion - Operator users cannot use a uniform collector configuration across all auto-instrumented workloads
Proposed Change
- Link both OTLP exporter libraries — Build the webserver module against both
opentelemetry_exporter_otlp_grpcandopentelemetry_exporter_otlp_http - Add runtime protocol selection — Read
OTEL_EXPORTER_OTLP_PROTOCOL(and the signal-specific variantsOTEL_EXPORTER_OTLP_TRACES_PROTOCOL, etc.) at exporter initialization time - Use the appropriate factory — Instantiate
OtlpHttpExporterFactoryorOtlpGrpcExporterFactorybased on the configured protocol - Default to
http/protobuf— Align with the OpenTelemetry specification default and the behavior of all other auto-instrumentations
This is architecturally straightforward because the upstream opentelemetry-cpp SDK already provides both exporters behind a shared SpanExporter interface. The webserver module pipeline is transport-agnostic — only the exporter instantiation point needs to change.
Scope
- Apache HTTPD auto-instrumentation
- Nginx auto-instrumentation
- CMake/build changes to link the HTTP exporter library and its dependency (libcurl)
- Supported protocol values:
grpc,http/protobuf,http/json
Related
- Discussion on separating OTLP proto from transport: https://github.com/open-telemetry/opentelemetry-cpp-contrib/discussions/410
- OpenTelemetry specification on
OTEL_EXPORTER_OTLP_PROTOCOL: https://opentelemetry.io/docs/specs/otel/protocol/exporter/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the otel-webserver-module exporter initialization and its CMake targets for Apache HTTPD and Nginx. Check how OTEL_EXPORTER_OTLP_PROTOCOL and its signal-specific variants should select the grpc, http/protobuf, or http/json factory, then verify both modules build with the HTTP exporter and default to http/protobuf.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, grpc
- Domain
- backend, observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100