Skip to content

[CODE HEALTH] Move remaining misc-use-internal-linkage sites into anonymous namespaces - #4350

Merged
dbarker merged 2 commits into
open-telemetry:mainfrom
om7057:code-health/misc-use-internal-linkage-part2-remainder
Aug 4, 2026
Merged

[CODE HEALTH] Move remaining misc-use-internal-linkage sites into anonymous namespaces#4350
dbarker merged 2 commits into
open-telemetry:mainfrom
om7057:code-health/misc-use-internal-linkage-part2-remainder

Conversation

@om7057

@om7057 om7057 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes the last four sites left open on #4196 after the earlier batch of PRs (#4199, #4200, #4217, #4225, #4231, #4286, #4301, #4302, #4303):

  • exporters/otlp/src/otlp_file_client.cc: OtlpFileSystemBackend and OtlpFileOstreamBackend extended into the file's existing anonymous namespace
  • exporters/elasticsearch/src/es_log_record_exporter.cc: ResponseHandler and AsyncResponseHandler wrapped in an anonymous namespace
  • exporters/elasticsearch/src/es_log_recordable.cc: json_assign_visitor wrapped in an anonymous namespace nested inside namespace nlohmann
  • functional/otlp/func_grpc_main.cc / func_http_main.cc: the TestMode / test_mode enums (declared before the file's existing anonymous namespace block, since the static variable using them is referenced throughout the whole translation unit) each given their own small anonymous-namespace wrap

All four are file-local classes/enums with no header exposure, so this is a mechanical, low-risk change with no behavior difference.

Test plan

  • opentelemetry_exporter_otlp_file_client builds clean (WITH_OTLP_FILE=ON)
  • opentelemetry_exporter_elasticsearch_logs builds clean (WITH_ELASTICSEARCH=ON), confirmed via object-file timestamps newer than the source edits
  • functional/otlp/func_http_main.cc compiles clean via direct compiler invocation (WITH_OTLP_HTTP=ON)
  • functional/otlp/func_grpc_main.cc syntax-checked clean (-fsyntax-only) using the project's real include paths (gRPC dependency build was skipped locally to avoid a slow from-source clone; the file itself doesn't depend on gRPC headers)

Fixes #4196

…nymous namespaces

Closes the last four sites left open on open-telemetry#4196: the OTLP file exporter's
OtlpFileSystemBackend/OtlpFileOstreamBackend, the Elasticsearch log
exporter's ResponseHandler/AsyncResponseHandler and json_assign_visitor,
and the TestMode/test_mode enums in the OTLP functional test binaries.
All are file-local with no header exposure.
@om7057
om7057 requested a review from a team as a code owner August 3, 2026 19:23
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.85%. Comparing base (e79ab1f) to head (320d2d3).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4350   +/-   ##
=======================================
  Coverage   80.85%   80.85%           
=======================================
  Files         450      450           
  Lines       19215    19215           
=======================================
  Hits        15535    15535           
  Misses       3680     3680           
Files with missing lines Coverage Δ
...orters/elasticsearch/src/es_log_record_exporter.cc 12.22% <ø> (ø)
exporters/elasticsearch/src/es_log_recordable.cc 65.39% <ø> (ø)
exporters/otlp/src/otlp_file_client.cc 70.38% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dbarker dbarker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

@dbarker
dbarker merged commit bbf970a into open-telemetry:main Aug 4, 2026
122 of 123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CODE HEALTH] clang-tidy misc-use-internal-linkage warnings part 2

3 participants