[CODE HEALTH] Move remaining misc-use-internal-linkage sites into anonymous namespaces - #4350
Merged
dbarker merged 2 commits intoAug 4, 2026
Conversation
…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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4350 +/- ##
=======================================
Coverage 80.85% 80.85%
=======================================
Files 450 450
Lines 19215 19215
=======================================
Hits 15535 15535
Misses 3680 3680
🚀 New features to boost your workflow:
|
marcalff
approved these changes
Aug 3, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:OtlpFileSystemBackendandOtlpFileOstreamBackendextended into the file's existing anonymous namespaceexporters/elasticsearch/src/es_log_record_exporter.cc:ResponseHandlerandAsyncResponseHandlerwrapped in an anonymous namespaceexporters/elasticsearch/src/es_log_recordable.cc:json_assign_visitorwrapped in an anonymous namespace nested insidenamespace nlohmannfunctional/otlp/func_grpc_main.cc/func_http_main.cc: theTestMode/test_modeenums (declared before the file's existing anonymous namespace block, since thestaticvariable using them is referenced throughout the whole translation unit) each given their own small anonymous-namespace wrapAll 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_clientbuilds clean (WITH_OTLP_FILE=ON)opentelemetry_exporter_elasticsearch_logsbuilds clean (WITH_ELASTICSEARCH=ON), confirmed via object-file timestamps newer than the source editsfunctional/otlp/func_http_main.cccompiles clean via direct compiler invocation (WITH_OTLP_HTTP=ON)functional/otlp/func_grpc_main.ccsyntax-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