open-telemetry / open-telemetry/opentelemetry-cpp-contrib

Add HTTP/protobuf OTLP export support to otel-webserver-module

Open
#614 0 comments 0 reactions 0 assignees View on GitHub

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_PROTOCOL environment variable is silently ignored, leading to confusion
  • Operator users cannot use a uniform collector configuration across all auto-instrumented workloads

Proposed Change

  1. Link both OTLP exporter libraries — Build the webserver module against both opentelemetry_exporter_otlp_grpc and opentelemetry_exporter_otlp_http
  2. Add runtime protocol selection — Read OTEL_EXPORTER_OTLP_PROTOCOL (and the signal-specific variants OTEL_EXPORTER_OTLP_TRACES_PROTOCOL, etc.) at exporter initialization time
  3. Use the appropriate factory — Instantiate OtlpHttpExporterFactory or OtlpGrpcExporterFactory based on the configured protocol
  4. 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.