open-telemetry / open-telemetry/opentelemetry-cpp

Move the embedded HTTP server headers out of ext/include

Open
#4,332 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

do-not-stale triage/accepted
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

ext/include/opentelemetry/ext/http/server/http_server.h and socket_tools.h are an embedded HTTP server used by tests and by the http example. They sit under ext/include beside the user facing client headers, which makes them look like part of the public surface even though nothing supported points at them.

#4327 replaced the *.h glob in the ext_common component with an explicit manifest and left both out, so the package no longer installs them. That fixes the packaging side. The files are still in a public looking location, and @dbarker asked for a follow up so the move itself does not get lost.

What uses them today
  • ext/test/http/socket_tools_test.cc
  • ext/test/http/curl_http_test.cc
  • ext/test/w3c_tracecontext_http_test_server/main.cc
  • exporters/otlp/test/otlp_http_exporter_test.cc
  • exporters/otlp/test/otlp_http_log_record_exporter_test.cc
  • exporters/zipkin/test/zipkin_exporter_test.cc
  • examples/http/server.h

Everything except the example is a test. That list is the full transitive closure over the include graph on main, so nothing under functional/ is involved.

What a move would settle

Each of those targets now links ws2_32 on Windows for itself, because #4327 took that link off the opentelemetry_ext interface once the headers stopped shipping. On the Bazel side //ext:headers still globs the whole include tree, so its -DEFAULTLIB:Ws2_32.lib linkopt is still load bearing and stays. Moving the files gives both build systems the same story: a server target that owns its own Winsock dependency, and an ext target that is only the HTTP client.

test_common is one candidate, though the http example is not a test, so a small dedicated target may fit better. Happy to take this on once there is a preferred destination.

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 tracing the includes from ext/test/http/socket_tools_test.cc, the listed exporter tests, and examples/http/server.h, then inspect the test_common and ext targets. The destination is not yet settled: compare test_common with a dedicated server target. Done means the headers move out of ext/include, all listed targets still build, and Winsock ownership remains correct for both build systems.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.