From f6a4f5cedde409bdb6cc458458c2aa008f9eb555 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 17 Jun 2024 22:35:26 +0200 Subject: [PATCH 01/15] Contributes to #2054 --- .github/workflows/iwyu.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index 29b8274fbd..51315cb782 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -40,6 +40,12 @@ jobs: -DBUILD_TESTING=OFF \ -DWITH_DEPRECATED_SDK_FACTORY=OFF \ -DBUILD_W3CTRACECONTEXT_TEST=OFF \ + -DWITH_OTLP_GRPC=ON \ + -DWITH_OTLP_HTTP=ON \ + -DWITH_OTLP_FILE=ON \ + -DWITH_OTLP_HTTP_COMPRESSION=ON \ + -DWITH_ZIPKIN=ON \ + -DWITH_PROMETHEUS=ON \ .. - name: iwyu_tool From 1709c4efddae5d6d239eb81e6df7b77f580e1d3a Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 17 Jun 2024 22:49:15 +0200 Subject: [PATCH 02/15] Add grpc --- .github/workflows/iwyu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index 51315cb782..787394be69 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -26,6 +26,7 @@ jobs: libssl-dev \ libcurl4-openssl-dev \ libprotobuf-dev \ + libgrpc-dev \ protobuf-compiler \ libgmock-dev \ libgtest-dev \ @@ -36,6 +37,7 @@ jobs: TOPDIR=`pwd` mkdir build && cd build CC="clang" CXX="clang++" cmake \ + -DCMAKE_CXX_STANDARD=14 \ -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \ -DBUILD_TESTING=OFF \ -DWITH_DEPRECATED_SDK_FACTORY=OFF \ From 7c6ab11d529be3d9863d5a7b9ef6b8821cd9f397 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 17 Jun 2024 22:52:33 +0200 Subject: [PATCH 03/15] Add libgrpc++-dev --- .github/workflows/iwyu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index 787394be69..cba95c1034 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -27,6 +27,7 @@ jobs: libcurl4-openssl-dev \ libprotobuf-dev \ libgrpc-dev \ + libgrpc++-dev \ protobuf-compiler \ libgmock-dev \ libgtest-dev \ From 2468809d94baa0f80ff1bf3db711171e2f79ab1f Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 17 Jun 2024 22:57:43 +0200 Subject: [PATCH 04/15] Start with only OTLP HTTP --- .github/workflows/iwyu.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index cba95c1034..6799346a87 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -26,8 +26,6 @@ jobs: libssl-dev \ libcurl4-openssl-dev \ libprotobuf-dev \ - libgrpc-dev \ - libgrpc++-dev \ protobuf-compiler \ libgmock-dev \ libgtest-dev \ @@ -43,12 +41,12 @@ jobs: -DBUILD_TESTING=OFF \ -DWITH_DEPRECATED_SDK_FACTORY=OFF \ -DBUILD_W3CTRACECONTEXT_TEST=OFF \ - -DWITH_OTLP_GRPC=ON \ + -DWITH_OTLP_GRPC=OFF \ -DWITH_OTLP_HTTP=ON \ -DWITH_OTLP_FILE=ON \ -DWITH_OTLP_HTTP_COMPRESSION=ON \ -DWITH_ZIPKIN=ON \ - -DWITH_PROMETHEUS=ON \ + -DWITH_PROMETHEUS=OFF \ .. - name: iwyu_tool From 78be757a17f7c7361a5a60d1aed7eafbe3d441bb Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 17 Jun 2024 23:36:31 +0200 Subject: [PATCH 05/15] Cleanup --- cmake/opentelemetry-proto.cmake | 6 ++++++ .../exporters/otlp/otlp_environment.h | 12 ++++------- exporters/otlp/src/otlp_environment.cc | 12 +++++++---- .../ext/http/client/curl/http_client_curl.h | 21 ++++++++++++------- ext/src/http/client/curl/http_client_curl.cc | 8 +++++-- .../client/curl/http_client_factory_curl.cc | 2 ++ .../http/client/curl/http_operation_curl.cc | 21 +++++++++++++++++-- 7 files changed, 59 insertions(+), 23 deletions(-) diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake index 19516c3b71..8dffc79c6b 100644 --- a/cmake/opentelemetry-proto.cmake +++ b/cmake/opentelemetry-proto.cmake @@ -326,6 +326,12 @@ add_library( ${LOGS_SERVICE_PB_CPP_FILE} ${METRICS_SERVICE_PB_CPP_FILE}) +# Disable include-what-you-use on generated code. +set_target_properties( + opentelemetry_proto + PROPERTIES CMAKE_CXX_INCLUDE_WHAT_YOU_USE "" +) + if(WITH_ABSEIL) target_link_libraries(opentelemetry_proto PUBLIC absl::bad_variant_access) endif() diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h index c2e0afb7bc..25a4c0714d 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h @@ -3,18 +3,14 @@ #pragma once -#include "opentelemetry/common/kv_properties.h" -#include "opentelemetry/nostd/string_view.h" - -#include "opentelemetry/sdk/common/attribute_utils.h" -#include "opentelemetry/sdk/common/env_variables.h" -#include "opentelemetry/sdk/version/version.h" - +#include #include #include #include #include -#include + +#include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/src/otlp_environment.cc b/exporters/otlp/src/otlp_environment.cc index a7af30bb73..a7c143a45d 100644 --- a/exporters/otlp/src/otlp_environment.cc +++ b/exporters/otlp/src/otlp_environment.cc @@ -1,13 +1,17 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include +#include +#include +#include "opentelemetry/common/kv_properties.h" +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/nostd/detail/decay.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/common/env_variables.h" -#include "opentelemetry/sdk/version/version.h" - #include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk_config.h" namespace nostd = opentelemetry::nostd; namespace sdk_common = opentelemetry::sdk::common; diff --git a/ext/include/opentelemetry/ext/http/client/curl/http_client_curl.h b/ext/include/opentelemetry/ext/http/client/curl/http_client_curl.h index 63702be09a..902981f392 100644 --- a/ext/include/opentelemetry/ext/http/client/curl/http_client_curl.h +++ b/ext/include/opentelemetry/ext/http/client/curl/http_client_curl.h @@ -3,20 +3,27 @@ #pragma once -#include "opentelemetry/ext/http/client/curl/http_operation_curl.h" -#include "opentelemetry/ext/http/client/http_client.h" -#include "opentelemetry/ext/http/common/url_parser.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/version.h" - +#include #include +#include +#include +#include #include +#include +#include #include #include #include #include #include -#include +#include + +#include "opentelemetry/ext/http/client/curl/http_operation_curl.h" +#include "opentelemetry/ext/http/client/http_client.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace ext diff --git a/ext/src/http/client/curl/http_client_curl.cc b/ext/src/http/client/curl/http_client_curl.cc index 11c1435b1f..c330af3da5 100644 --- a/ext/src/http/client/curl/http_client_curl.cc +++ b/ext/src/http/client/curl/http_client_curl.cc @@ -1,15 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + #include "opentelemetry/ext/http/client/curl/http_client_curl.h" +#include "opentelemetry/ext/http/common/url_parser.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" #ifdef ENABLE_OTLP_COMPRESSION_PREVIEW # include #endif -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace ext { diff --git a/ext/src/http/client/curl/http_client_factory_curl.cc b/ext/src/http/client/curl/http_client_factory_curl.cc index f6266c2931..fd0a7d6a81 100644 --- a/ext/src/http/client/curl/http_client_factory_curl.cc +++ b/ext/src/http/client/curl/http_client_factory_curl.cc @@ -1,6 +1,8 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include + #include "opentelemetry/ext/http/client/curl/http_client_curl.h" #include "opentelemetry/ext/http/client/http_client.h" #include "opentelemetry/ext/http/client/http_client_factory.h" diff --git a/ext/src/http/client/curl/http_operation_curl.cc b/ext/src/http/client/curl/http_operation_curl.cc index 25f43fcb2f..67571071f5 100644 --- a/ext/src/http/client/curl/http_operation_curl.cc +++ b/ext/src/http/client/curl/http_operation_curl.cc @@ -1,12 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include #include - -#include "opentelemetry/ext/http/client/curl/http_operation_curl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "opentelemetry/ext/http/client/curl/http_client_curl.h" +#include "opentelemetry/ext/http/client/curl/http_operation_curl.h" +#include "opentelemetry/ext/http/client/http_client.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" // CURL_VERSION_BITS was added in CURL 7.43.0 #ifndef CURL_VERSION_BITS From d42cf6c7a23eee1d490092ef3ad73d6fda28e26a Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 17 Jun 2024 23:52:42 +0200 Subject: [PATCH 06/15] Cleanup --- cmake/opentelemetry-proto.cmake | 2 +- exporters/otlp/src/otlp_environment.cc | 4 ++++ ext/src/http/client/curl/http_client_curl.cc | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake index 8dffc79c6b..62197068e2 100644 --- a/cmake/opentelemetry-proto.cmake +++ b/cmake/opentelemetry-proto.cmake @@ -329,7 +329,7 @@ add_library( # Disable include-what-you-use on generated code. set_target_properties( opentelemetry_proto - PROPERTIES CMAKE_CXX_INCLUDE_WHAT_YOU_USE "" + PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "" ) if(WITH_ABSEIL) diff --git a/exporters/otlp/src/otlp_environment.cc b/exporters/otlp/src/otlp_environment.cc index a7c143a45d..a8b4cb80cd 100644 --- a/exporters/otlp/src/otlp_environment.cc +++ b/exporters/otlp/src/otlp_environment.cc @@ -1,6 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include #include #include #include @@ -12,6 +15,7 @@ #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/common/env_variables.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" namespace nostd = opentelemetry::nostd; namespace sdk_common = opentelemetry::sdk::common; diff --git a/ext/src/http/client/curl/http_client_curl.cc b/ext/src/http/client/curl/http_client_curl.cc index c330af3da5..29f020f7ef 100644 --- a/ext/src/http/client/curl/http_client_curl.cc +++ b/ext/src/http/client/curl/http_client_curl.cc @@ -1,12 +1,28 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include "opentelemetry/ext/http/client/curl/http_client_curl.h" +#include "opentelemetry/ext/http/client/curl/http_operation_curl.h" +#include "opentelemetry/ext/http/client/http_client.h" #include "opentelemetry/ext/http/common/url_parser.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/version.h" From 2b44bd1b4a32badac96ad112a3a7cb18909b9338 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 18 Jun 2024 00:33:33 +0200 Subject: [PATCH 07/15] Cleanup --- .github/workflows/iwyu.yml | 1 + .../otlp/otlp_populate_attribute_utils.h | 31 +++++++++++++++---- .../exporters/otlp/otlp_recordable.h | 22 ++++++++++--- exporters/otlp/src/otlp_environment.cc | 1 - exporters/otlp/src/otlp_log_recordable.cc | 16 ++++++++-- .../otlp/src/otlp_populate_attribute_utils.cc | 17 ++++++++++ exporters/otlp/src/otlp_recordable.cc | 9 ++++-- ext/src/http/client/curl/http_client_curl.cc | 3 +- 8 files changed, 84 insertions(+), 16 deletions(-) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index 6799346a87..598f57e97e 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -37,6 +37,7 @@ jobs: mkdir build && cd build CC="clang" CXX="clang++" cmake \ -DCMAKE_CXX_STANDARD=14 \ + -DWITH_STL=CXX14 \ -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \ -DBUILD_TESTING=OFF \ -DWITH_DEPRECATED_SDK_FACTORY=OFF \ diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h index dc43827641..499aa3685f 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h @@ -3,18 +3,37 @@ #pragma once -// clang-format off -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" -#include "opentelemetry/proto/resource/v1/resource.pb.h" -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" -// clang-format on - #include "opentelemetry/common/attribute_value.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" +namespace opentelemetry +{ +namespace proto +{ + +namespace common +{ +namespace v1 +{ +class AnyValue; +class KeyValue; +} // namespace v1 +} // namespace common + +namespace resource +{ +namespace v1 +{ +class Resource; +} +} // namespace resource + +} // namespace proto +} // namespace opentelemetry + OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h index 88e7cd91cf..103357d11f 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h @@ -3,14 +3,28 @@ #pragma once -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" +#include +#include +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "opentelemetry/proto/common/v1/common.pb.h" #include "opentelemetry/proto/resource/v1/resource.pb.h" #include "opentelemetry/proto/trace/v1/trace.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_flags.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/src/otlp_environment.cc b/exporters/otlp/src/otlp_environment.cc index a8b4cb80cd..df60f80a76 100644 --- a/exporters/otlp/src/otlp_environment.cc +++ b/exporters/otlp/src/otlp_environment.cc @@ -14,7 +14,6 @@ #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/common/env_variables.h" -#include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/version.h" namespace nostd = opentelemetry::nostd; diff --git a/exporters/otlp/src/otlp_log_recordable.cc b/exporters/otlp/src/otlp_log_recordable.cc index 8acb4073d2..d232a0066a 100644 --- a/exporters/otlp/src/otlp_log_recordable.cc +++ b/exporters/otlp/src/otlp_log_recordable.cc @@ -1,12 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/common/macros.h" +#include +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" -#include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/logs/severity.h" +#include "opentelemetry/nostd/detail/decay.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/proto/logs/v1/logs.pb.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/logs/readable_log_record.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_flags.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" namespace nostd = opentelemetry::nostd; diff --git a/exporters/otlp/src/otlp_populate_attribute_utils.cc b/exporters/otlp/src/otlp_populate_attribute_utils.cc index 69a284835a..edee6f572e 100644 --- a/exporters/otlp/src/otlp_populate_attribute_utils.cc +++ b/exporters/otlp/src/otlp_populate_attribute_utils.cc @@ -1,7 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/version.h" + +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "opentelemetry/proto/common/v1/common.pb.h" +#include "opentelemetry/proto/resource/v1/resource.pb.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on namespace nostd = opentelemetry::nostd; diff --git a/exporters/otlp/src/otlp_recordable.cc b/exporters/otlp/src/otlp_recordable.cc index f9cee24677..57e87bf591 100644 --- a/exporters/otlp/src/otlp_recordable.cc +++ b/exporters/otlp/src/otlp_recordable.cc @@ -1,10 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_recordable.h" +#include #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" -#include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/exporters/otlp/otlp_recordable.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/trace_state.h" +#include "opentelemetry/version.h" namespace nostd = opentelemetry::nostd; diff --git a/ext/src/http/client/curl/http_client_curl.cc b/ext/src/http/client/curl/http_client_curl.cc index 29f020f7ef..07464a8dd6 100644 --- a/ext/src/http/client/curl/http_client_curl.cc +++ b/ext/src/http/client/curl/http_client_curl.cc @@ -23,11 +23,12 @@ #include "opentelemetry/ext/http/common/url_parser.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/version.h" #ifdef ENABLE_OTLP_COMPRESSION_PREVIEW # include +#else +# include "opentelemetry/sdk/common/global_log_handler.h" #endif OPENTELEMETRY_BEGIN_NAMESPACE From abfa31ade8164fc43118545fa89ae32b96a375ca Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 18 Jun 2024 00:47:45 +0200 Subject: [PATCH 08/15] nostd / std cleanup --- api/include/opentelemetry/std/shared_ptr.h | 2 ++ api/include/opentelemetry/std/string_view.h | 2 ++ api/include/opentelemetry/std/unique_ptr.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/api/include/opentelemetry/std/shared_ptr.h b/api/include/opentelemetry/std/shared_ptr.h index b1b99bd36c..0ca860476e 100644 --- a/api/include/opentelemetry/std/shared_ptr.h +++ b/api/include/opentelemetry/std/shared_ptr.h @@ -3,6 +3,8 @@ #pragma once +// IWYU pragma: private, include "opentelemetry/nostd/shared_ptr.h" + #include #include "opentelemetry/version.h" diff --git a/api/include/opentelemetry/std/string_view.h b/api/include/opentelemetry/std/string_view.h index 5295eb4544..d0f0c08125 100644 --- a/api/include/opentelemetry/std/string_view.h +++ b/api/include/opentelemetry/std/string_view.h @@ -3,6 +3,8 @@ #pragma once +// IWYU pragma: private, include "opentelemetry/nostd/string_view.h" + #include #include "opentelemetry/version.h" diff --git a/api/include/opentelemetry/std/unique_ptr.h b/api/include/opentelemetry/std/unique_ptr.h index 1d7d9b1fc7..e1a0490742 100644 --- a/api/include/opentelemetry/std/unique_ptr.h +++ b/api/include/opentelemetry/std/unique_ptr.h @@ -3,6 +3,8 @@ #pragma once +// IWYU pragma: private, include "opentelemetry/nostd/unique_ptr.h" + #include #include "opentelemetry/version.h" From 34386fd00085bb0f89f12c8535739071152df1e3 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 18 Jun 2024 01:26:50 +0200 Subject: [PATCH 09/15] More nostd / std cleanup --- api/include/opentelemetry/std/span.h | 2 ++ api/include/opentelemetry/std/type_traits.h | 2 ++ api/include/opentelemetry/std/utility.h | 2 ++ api/include/opentelemetry/std/variant.h | 2 ++ sdk/src/logs/logger_provider.cc | 1 - sdk/src/logs/readable_log_record.cc | 1 - sdk/src/metrics/meter_provider.cc | 1 - sdk/src/trace/tracer.cc | 1 - sdk/src/trace/tracer_provider.cc | 1 - 9 files changed, 8 insertions(+), 5 deletions(-) diff --git a/api/include/opentelemetry/std/span.h b/api/include/opentelemetry/std/span.h index 1160d54fbe..5d20e0227f 100644 --- a/api/include/opentelemetry/std/span.h +++ b/api/include/opentelemetry/std/span.h @@ -3,6 +3,8 @@ #pragma once +// IWYU pragma: private, include "opentelemetry/nostd/span.h" + #include "opentelemetry/version.h" // Standard library implementation requires at least C++17 compiler. diff --git a/api/include/opentelemetry/std/type_traits.h b/api/include/opentelemetry/std/type_traits.h index f26af95b94..074f796798 100644 --- a/api/include/opentelemetry/std/type_traits.h +++ b/api/include/opentelemetry/std/type_traits.h @@ -3,6 +3,8 @@ #pragma once +// IWYU pragma: private, include "opentelemetry/nostd/type_traits.h" + #include #include "opentelemetry/version.h" diff --git a/api/include/opentelemetry/std/utility.h b/api/include/opentelemetry/std/utility.h index be0f1e5f46..d1f5614d7c 100644 --- a/api/include/opentelemetry/std/utility.h +++ b/api/include/opentelemetry/std/utility.h @@ -3,6 +3,8 @@ #pragma once +// IWYU pragma: private, include "opentelemetry/nostd/utility.h" + #include #include diff --git a/api/include/opentelemetry/std/variant.h b/api/include/opentelemetry/std/variant.h index 6acdb81e9a..58bc510c5f 100644 --- a/api/include/opentelemetry/std/variant.h +++ b/api/include/opentelemetry/std/variant.h @@ -3,6 +3,8 @@ #pragma once +// IWYU pragma: private, include "opentelemetry/nostd/variant.h" + #include "opentelemetry/version.h" #include diff --git a/sdk/src/logs/logger_provider.cc b/sdk/src/logs/logger_provider.cc index c3b1fb7dd4..0530b86bd1 100644 --- a/sdk/src/logs/logger_provider.cc +++ b/sdk/src/logs/logger_provider.cc @@ -12,7 +12,6 @@ #include "opentelemetry/logs/logger.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/logs/logger.h" diff --git a/sdk/src/logs/readable_log_record.cc b/sdk/src/logs/readable_log_record.cc index 4c8d119347..8d35c1eb2e 100644 --- a/sdk/src/logs/readable_log_record.cc +++ b/sdk/src/logs/readable_log_record.cc @@ -7,7 +7,6 @@ #include "opentelemetry/logs/severity.h" #include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/logs/readable_log_record.h" #include "opentelemetry/sdk/resource/resource.h" diff --git a/sdk/src/metrics/meter_provider.cc b/sdk/src/metrics/meter_provider.cc index 959ff32800..0efab63cb9 100644 --- a/sdk/src/metrics/meter_provider.cc +++ b/sdk/src/metrics/meter_provider.cc @@ -4,7 +4,6 @@ #include #include #include -#include #include #include "opentelemetry/common/key_value_iterable.h" diff --git a/sdk/src/trace/tracer.cc b/sdk/src/trace/tracer.cc index f23ce5f628..ce402e4f50 100644 --- a/sdk/src/trace/tracer.cc +++ b/sdk/src/trace/tracer.cc @@ -12,7 +12,6 @@ #include "opentelemetry/context/context.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/trace/id_generator.h" diff --git a/sdk/src/trace/tracer_provider.cc b/sdk/src/trace/tracer_provider.cc index 7421e07de4..9791f1c3cd 100644 --- a/sdk/src/trace/tracer_provider.cc +++ b/sdk/src/trace/tracer_provider.cc @@ -5,7 +5,6 @@ #include #include #include -#include #include #include From 21149c3caf6885983d70ff223bd35d9133c45451 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 21 Jun 2024 23:30:27 +0200 Subject: [PATCH 10/15] cleanup --- .../opentelemetry/exporters/otlp/otlp_http.h | 3 +- .../exporters/otlp/otlp_http_client.h | 16 ++++----- .../exporters/otlp/otlp_http_exporter.h | 17 ++++----- .../otlp/otlp_http_exporter_factory.h | 1 + .../otlp/otlp_http_exporter_options.h | 8 ++--- .../otlp/otlp_http_log_record_exporter.h | 15 ++++---- .../otlp_http_log_record_exporter_factory.h | 5 +-- .../otlp_http_log_record_exporter_options.h | 8 ++--- .../otlp/otlp_http_metric_exporter.h | 14 ++++---- .../exporters/otlp/otlp_metric_utils.h | 32 +++++++++++++---- .../exporters/otlp/otlp_recordable_utils.h | 36 ++++++++++++++----- exporters/otlp/src/otlp_environment.cc | 1 - exporters/otlp/src/otlp_log_recordable.cc | 1 - exporters/otlp/src/otlp_metric_utils.cc | 17 +++++++++ .../otlp/src/otlp_populate_attribute_utils.cc | 5 +++ exporters/otlp/src/otlp_recordable.cc | 22 ++++++++++++ exporters/otlp/src/otlp_recordable_utils.cc | 33 +++++++++++------ exporters/otlp/test/otlp_recordable_test.cc | 6 ++++ 18 files changed, 164 insertions(+), 76 deletions(-) diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http.h index 7d1e7bac55..6899c6f544 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http.h @@ -3,9 +3,8 @@ #pragma once -#include "opentelemetry/common/macros.h" #include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h index 9d79b5d99b..6806f1cdf9 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h @@ -3,14 +3,6 @@ #pragma once -#include "opentelemetry/ext/http/client/http_client.h" -#include "opentelemetry/nostd/variant.h" -#include "opentelemetry/sdk/common/exporter_utils.h" - -#include "opentelemetry/exporters/otlp/otlp_environment.h" -#include "opentelemetry/exporters/otlp/otlp_http.h" - -#include #include #include #include @@ -21,6 +13,14 @@ #include #include +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" +#include "opentelemetry/ext/http/client/http_client.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/version.h" + // forward declare google::protobuf::Message namespace google { diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h index b5faf1a9b8..38f1d9e306 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h @@ -3,19 +3,16 @@ #pragma once -// We need include exporter.h first, which will include Windows.h with NOMINMAX on Windows -#include "opentelemetry/sdk/trace/exporter.h" +#include +#include #include "opentelemetry/exporters/otlp/otlp_http_client.h" - -#include "opentelemetry/exporters/otlp/otlp_environment.h" - #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" - -#include -#include -#include -#include +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_factory.h index 5316528365..9e072a0534 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_factory.h @@ -7,6 +7,7 @@ #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" #include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h index 1be4bd8d95..7f6d5a1b35 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h @@ -3,15 +3,13 @@ #pragma once +#include +#include + #include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/version.h" -#include -#include -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h index f481fdab0b..9439e5725b 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h @@ -3,17 +3,16 @@ #pragma once -#include "opentelemetry/sdk/logs/exporter.h" +#include +#include #include "opentelemetry/exporters/otlp/otlp_http_client.h" - -#include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h" - -#include -#include -#include -#include +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_factory.h index f4c90d5b0c..c1e9de9ae1 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_factory.h @@ -3,10 +3,11 @@ #pragma once +#include + #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h" #include "opentelemetry/sdk/logs/exporter.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h index 7d60a28cf0..60f674a3a7 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h @@ -3,15 +3,13 @@ #pragma once +#include +#include + #include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/version.h" -#include -#include -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h index 0aebf79760..d74177e5c9 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h @@ -3,16 +3,16 @@ #pragma once -#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include +#include -#include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http_client.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" - -#include -#include -#include -#include +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_metric_utils.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_metric_utils.h index c6e11aeff3..4f92b8e665 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_metric_utils.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_metric_utils.h @@ -3,16 +3,34 @@ #pragma once -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" +#include "opentelemetry/exporters/otlp/otlp_preferred_temporality.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/version.h" -#include "opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h" +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "opentelemetry/proto/metrics/v1/metrics.pb.h" -#include "opentelemetry/proto/resource/v1/resource.pb.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on -#include "opentelemetry/exporters/otlp/otlp_preferred_temporality.h" -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/sdk/metrics/export/metric_producer.h" +namespace opentelemetry +{ +namespace proto +{ +namespace collector +{ +namespace metrics +{ +namespace v1 +{ +class ExportMetricsServiceRequest; +} +} // namespace metrics +} // namespace collector +} // namespace proto +} // namespace opentelemetry OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable_utils.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable_utils.h index 74a4cd9aeb..0651abc2b9 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable_utils.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable_utils.h @@ -5,18 +5,36 @@ #include -#include "opentelemetry/nostd/unique_ptr.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - -#include "opentelemetry/proto/collector/logs/v1/logs_service.pb.h" -#include "opentelemetry/proto/collector/trace/v1/trace_service.pb.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/version.h" -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" +namespace opentelemetry +{ +namespace proto +{ +namespace collector +{ -#include "opentelemetry/sdk/trace/recordable.h" +namespace logs +{ +namespace v1 +{ +class ExportLogsServiceRequest; +} +} // namespace logs +namespace trace +{ +namespace v1 +{ +class ExportTraceServiceRequest; +} +} // namespace trace -#include "opentelemetry/sdk/logs/recordable.h" +} // namespace collector +} // namespace proto +} // namespace opentelemetry OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/src/otlp_environment.cc b/exporters/otlp/src/otlp_environment.cc index df60f80a76..b68fcda73e 100644 --- a/exporters/otlp/src/otlp_environment.cc +++ b/exporters/otlp/src/otlp_environment.cc @@ -16,7 +16,6 @@ #include "opentelemetry/sdk/common/env_variables.h" #include "opentelemetry/version.h" -namespace nostd = opentelemetry::nostd; namespace sdk_common = opentelemetry::sdk::common; /* diff --git a/exporters/otlp/src/otlp_log_recordable.cc b/exporters/otlp/src/otlp_log_recordable.cc index d232a0066a..449025b52b 100644 --- a/exporters/otlp/src/otlp_log_recordable.cc +++ b/exporters/otlp/src/otlp_log_recordable.cc @@ -8,7 +8,6 @@ #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" #include "opentelemetry/logs/severity.h" -#include "opentelemetry/nostd/detail/decay.h" #include "opentelemetry/nostd/span.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/proto/logs/v1/logs.pb.h" diff --git a/exporters/otlp/src/otlp_metric_utils.cc b/exporters/otlp/src/otlp_metric_utils.cc index e75b17ddd7..2273bbc9bd 100644 --- a/exporters/otlp/src/otlp_metric_utils.cc +++ b/exporters/otlp/src/otlp_metric_utils.cc @@ -1,9 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" + +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h" +#include "opentelemetry/proto/common/v1/common.pb.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/src/otlp_populate_attribute_utils.cc b/exporters/otlp/src/otlp_populate_attribute_utils.cc index edee6f572e..a2ef2edafa 100644 --- a/exporters/otlp/src/otlp_populate_attribute_utils.cc +++ b/exporters/otlp/src/otlp_populate_attribute_utils.cc @@ -8,9 +8,14 @@ #include #include +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/utility.h" #include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" // clang-format off diff --git a/exporters/otlp/src/otlp_recordable.cc b/exporters/otlp/src/otlp_recordable.cc index 57e87bf591..3754964f86 100644 --- a/exporters/otlp/src/otlp_recordable.cc +++ b/exporters/otlp/src/otlp_recordable.cc @@ -2,15 +2,37 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include +#include +#include +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_flags.h" #include "opentelemetry/trace/trace_id.h" #include "opentelemetry/trace/trace_state.h" #include "opentelemetry/version.h" +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "opentelemetry/proto/common/v1/common.pb.h" +#include "opentelemetry/proto/resource/v1/resource.pb.h" +#include "opentelemetry/proto/trace/v1/trace.pb.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on + namespace nostd = opentelemetry::nostd; OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/src/otlp_recordable_utils.cc b/exporters/otlp/src/otlp_recordable_utils.cc index 59e4aadf4e..b68f60d544 100644 --- a/exporters/otlp/src/otlp_recordable_utils.cc +++ b/exporters/otlp/src/otlp_recordable_utils.cc @@ -1,21 +1,32 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - -#include "opentelemetry/proto/logs/v1/logs.pb.h" -#include "opentelemetry/proto/trace/v1/trace.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" +#include +#include +#include +#include +#include +#include #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" - -#include -#include +#include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/resource/resource.h" + +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "opentelemetry/proto/collector/logs/v1/logs_service.pb.h" +#include "opentelemetry/proto/collector/trace/v1/trace_service.pb.h" +#include "opentelemetry/proto/common/v1/common.pb.h" +#include "opentelemetry/proto/logs/v1/logs.pb.h" +#include "opentelemetry/proto/resource/v1/resource.pb.h" +#include "opentelemetry/proto/trace/v1/trace.pb.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on namespace nostd = opentelemetry::nostd; diff --git a/exporters/otlp/test/otlp_recordable_test.cc b/exporters/otlp/test/otlp_recordable_test.cc index 9f3ba62b16..caa17c8a46 100644 --- a/exporters/otlp/test/otlp_recordable_test.cc +++ b/exporters/otlp/test/otlp_recordable_test.cc @@ -13,6 +13,12 @@ #include +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "opentelemetry/proto/collector/trace/v1/trace_service.pb.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on + OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { From a6fe0e9992aa4772b203212ae33d46ed9f06e7fc Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 22 Jun 2024 00:29:21 +0200 Subject: [PATCH 11/15] cleanup --- .../exporters/otlp/otlp_file_client.h | 9 +++-- .../exporters/otlp/otlp_file_exporter.h | 13 +++--- .../otlp/otlp_file_log_record_exporter.h | 14 +++---- .../otlp_file_log_record_exporter_factory.h | 1 + .../otlp/otlp_file_metric_exporter.h | 14 +++---- .../otlp/otlp_file_metric_exporter_factory.h | 1 + .../otlp/otlp_http_metric_exporter_factory.h | 5 ++- .../otlp/otlp_http_metric_exporter_options.h | 8 ++-- exporters/otlp/src/otlp_environment.cc | 1 - exporters/otlp/src/otlp_file_exporter.cc | 19 +++++---- .../otlp/src/otlp_file_log_record_exporter.cc | 12 +++--- .../otlp/src/otlp_file_metric_exporter.cc | 18 ++++++--- exporters/otlp/src/otlp_http_client.cc | 40 ++++++++----------- exporters/otlp/src/otlp_http_exporter.cc | 20 +++++++--- .../otlp/src/otlp_http_exporter_options.cc | 7 ++-- .../otlp/src/otlp_http_log_record_exporter.cc | 24 ++++++----- .../otlp_http_log_record_exporter_options.cc | 7 ++-- .../otlp/src/otlp_http_metric_exporter.cc | 23 +++++++---- .../src/otlp_http_metric_exporter_options.cc | 7 ++-- exporters/otlp/src/otlp_log_recordable.cc | 4 +- exporters/otlp/src/otlp_metric_utils.cc | 6 +++ exporters/otlp/src/otlp_recordable_utils.cc | 12 +++--- .../exporters/zipkin/recordable.h | 14 +++++++ .../exporters/zipkin/zipkin_exporter.h | 18 +++++---- .../zipkin/zipkin_exporter_factory.h | 1 + exporters/zipkin/src/recordable.cc | 16 ++++++-- exporters/zipkin/src/zipkin_exporter.cc | 4 +- .../zipkin/src/zipkin_exporter_factory.cc | 2 + .../sdk/common/global_log_handler.h | 1 + sdk/src/logs/event_logger.cc | 1 + 30 files changed, 193 insertions(+), 129 deletions(-) diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_client.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_client.h index bedbe77e52..e377b140b6 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_client.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_client.h @@ -3,12 +3,13 @@ #pragma once -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/exporter_utils.h" +#include +#include #include "opentelemetry/exporters/otlp/otlp_file_client_options.h" - -#include +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/version.h" // forward declare google::protobuf::Message namespace google diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter.h index b5b87f9f88..b49dcef77f 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter.h @@ -3,15 +3,16 @@ #pragma once -// We need include exporter.h first, which will include Windows.h with NOMINMAX on Windows -#include "opentelemetry/sdk/trace/exporter.h" +#include +#include #include "opentelemetry/exporters/otlp/otlp_file_client.h" - #include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" - -#include -#include +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter.h index 79d816ae53..6fb9f6d844 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter.h @@ -3,16 +3,16 @@ #pragma once -#include "opentelemetry/sdk/logs/exporter.h" +#include +#include #include "opentelemetry/exporters/otlp/otlp_file_client.h" - #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter_options.h" - -#include -#include -#include -#include +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter_factory.h index 0e6c0143b9..663eeb189a 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter_factory.h @@ -7,6 +7,7 @@ #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter_options.h" #include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter.h index 165c7de99a..e03e544de9 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter.h @@ -3,16 +3,16 @@ #pragma once -#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include +#include #include "opentelemetry/exporters/otlp/otlp_file_client.h" - #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_options.h" - -#include -#include -#include -#include +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter_factory.h index 483e4aa5aa..a34c057fad 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter_factory.h @@ -7,6 +7,7 @@ #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_options.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h index 7fa7980470..a290d91fd0 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h @@ -3,10 +3,11 @@ #pragma once +#include + #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h index d5cf3072f8..82c91aa51f 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h @@ -3,16 +3,14 @@ #pragma once +#include +#include + #include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_preferred_temporality.h" #include "opentelemetry/version.h" -#include -#include -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/otlp/src/otlp_environment.cc b/exporters/otlp/src/otlp_environment.cc index b68fcda73e..276d9fc709 100644 --- a/exporters/otlp/src/otlp_environment.cc +++ b/exporters/otlp/src/otlp_environment.cc @@ -10,7 +10,6 @@ #include "opentelemetry/common/kv_properties.h" #include "opentelemetry/exporters/otlp/otlp_environment.h" -#include "opentelemetry/nostd/detail/decay.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/common/env_variables.h" diff --git a/exporters/otlp/src/otlp_file_exporter.cc b/exporters/otlp/src/otlp_file_exporter.cc index 816151719a..fe84da9b13 100644 --- a/exporters/otlp/src/otlp_file_exporter.cc +++ b/exporters/otlp/src/otlp_file_exporter.cc @@ -1,19 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_file_exporter.h" +#include +#include +#include + #include "opentelemetry/exporters/otlp/otlp_file_client.h" +#include "opentelemetry/exporters/otlp/otlp_file_client_options.h" +#include "opentelemetry/exporters/otlp/otlp_file_exporter.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "google/protobuf/arena.h" #include "opentelemetry/proto/collector/trace/v1/trace_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/src/otlp_file_log_record_exporter.cc b/exporters/otlp/src/otlp_file_log_record_exporter.cc index 49cbfd3ab2..b4839b22d3 100644 --- a/exporters/otlp/src/otlp_file_log_record_exporter.cc +++ b/exporters/otlp/src/otlp_file_log_record_exporter.cc @@ -4,15 +4,15 @@ #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter.h" #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "google/protobuf/arena.h" #include "opentelemetry/proto/collector/logs/v1/logs_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/src/otlp_file_metric_exporter.cc b/exporters/otlp/src/otlp_file_metric_exporter.cc index 2c414c31b4..6ccd80af88 100644 --- a/exporters/otlp/src/otlp_file_metric_exporter.cc +++ b/exporters/otlp/src/otlp_file_metric_exporter.cc @@ -1,17 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "google/protobuf/arena.h" #include "opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/src/otlp_http_client.cc b/exporters/otlp/src/otlp_http_client.cc index 8bada1e0e0..318a847ebf 100644 --- a/exporters/otlp/src/otlp_http_client.cc +++ b/exporters/otlp/src/otlp_http_client.cc @@ -1,7 +1,16 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_http_client.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if defined(HAVE_GSL) # include @@ -9,37 +18,22 @@ # include #endif +#include "nlohmann/json.hpp" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/exporters/otlp/otlp_http_client.h" #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/common/url_parser.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/base64.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" // clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" -// clang-format on - #include "google/protobuf/message.h" -#include "google/protobuf/reflection.h" -#include "google/protobuf/stubs/common.h" -#include "nlohmann/json.hpp" - -// clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // clang-format on -#include "opentelemetry/common/timestamp.h" -#include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/sdk/common/base64.h" -#include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk_config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - #ifdef GetMessage # undef GetMessage #endif diff --git a/exporters/otlp/src/otlp_http_exporter.cc b/exporters/otlp/src/otlp_http_exporter.cc index aa00c3f79a..67ca5854bb 100644 --- a/exporters/otlp/src/otlp_http_exporter.cc +++ b/exporters/otlp/src/otlp_http_exporter.cc @@ -1,18 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "google/protobuf/arena.h" #include "opentelemetry/proto/collector/trace/v1/trace_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on namespace nostd = opentelemetry::nostd; diff --git a/exporters/otlp/src/otlp_http_exporter_options.cc b/exporters/otlp/src/otlp_http_exporter_options.cc index d88b8d2e3d..4dfe4d6a9f 100644 --- a/exporters/otlp/src/otlp_http_exporter_options.cc +++ b/exporters/otlp/src/otlp_http_exporter_options.cc @@ -1,13 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" - #include -#include -#include #include +#include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/otlp/src/otlp_http_log_record_exporter.cc b/exporters/otlp/src/otlp_http_log_record_exporter.cc index 0d08c66a79..478fb66096 100644 --- a/exporters/otlp/src/otlp_http_log_record_exporter.cc +++ b/exporters/otlp/src/otlp_http_log_record_exporter.cc @@ -1,20 +1,25 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h" #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "google/protobuf/arena.h" #include "opentelemetry/proto/collector/logs/v1/logs_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" - -namespace nostd = opentelemetry::nostd; +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter @@ -82,7 +87,8 @@ OtlpHttpLogRecordExporter::MakeRecordable() noexcept } opentelemetry::sdk::common::ExportResult OtlpHttpLogRecordExporter::Export( - const nostd::span> &logs) noexcept + const opentelemetry::nostd::span> + &logs) noexcept { if (http_client_->IsShutdown()) { diff --git a/exporters/otlp/src/otlp_http_log_record_exporter_options.cc b/exporters/otlp/src/otlp_http_log_record_exporter_options.cc index cf2227a8d5..26a18a5969 100644 --- a/exporters/otlp/src/otlp_http_log_record_exporter_options.cc +++ b/exporters/otlp/src/otlp_http_log_record_exporter_options.cc @@ -1,13 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h" - #include -#include -#include #include +#include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/otlp/src/otlp_http_metric_exporter.cc b/exporters/otlp/src/otlp_http_metric_exporter.cc index 1782bb6acb..7677e1e32d 100644 --- a/exporters/otlp/src/otlp_http_metric_exporter.cc +++ b/exporters/otlp/src/otlp_http_metric_exporter.cc @@ -1,19 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/version.h" -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "google/protobuf/arena.h" #include "opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" - -namespace nostd = opentelemetry::nostd; +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/src/otlp_http_metric_exporter_options.cc b/exporters/otlp/src/otlp_http_metric_exporter_options.cc index 7e2c145639..3ecc20b1b9 100644 --- a/exporters/otlp/src/otlp_http_metric_exporter_options.cc +++ b/exporters/otlp/src/otlp_http_metric_exporter_options.cc @@ -1,13 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" - #include -#include -#include #include +#include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/otlp/src/otlp_log_recordable.cc b/exporters/otlp/src/otlp_log_recordable.cc index 449025b52b..03c89626f2 100644 --- a/exporters/otlp/src/otlp_log_recordable.cc +++ b/exporters/otlp/src/otlp_log_recordable.cc @@ -19,8 +19,6 @@ #include "opentelemetry/trace/trace_id.h" #include "opentelemetry/version.h" -namespace nostd = opentelemetry::nostd; - OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { @@ -227,7 +225,7 @@ void OtlpLogRecordable::SetTraceFlags(const opentelemetry::trace::TraceFlags &tr proto_record_.set_flags(trace_flags.flags()); } -void OtlpLogRecordable::SetAttribute(nostd::string_view key, +void OtlpLogRecordable::SetAttribute(opentelemetry::nostd::string_view key, const opentelemetry::common::AttributeValue &value) noexcept { OtlpPopulateAttributeUtils::PopulateAttribute(proto_record_.add_attributes(), key, value); diff --git a/exporters/otlp/src/otlp_metric_utils.cc b/exporters/otlp/src/otlp_metric_utils.cc index 2273bbc9bd..da162d117e 100644 --- a/exporters/otlp/src/otlp_metric_utils.cc +++ b/exporters/otlp/src/otlp_metric_utils.cc @@ -10,15 +10,21 @@ #include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" +#include "opentelemetry/exporters/otlp/otlp_preferred_temporality.h" #include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/version.h" // clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h" #include "opentelemetry/proto/common/v1/common.pb.h" +#include "opentelemetry/proto/metrics/v1/metrics.pb.h" #include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep // clang-format on diff --git a/exporters/otlp/src/otlp_recordable_utils.cc b/exporters/otlp/src/otlp_recordable_utils.cc index b68f60d544..df29cca838 100644 --- a/exporters/otlp/src/otlp_recordable_utils.cc +++ b/exporters/otlp/src/otlp_recordable_utils.cc @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -12,10 +13,13 @@ #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" -#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/version.h" // clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep @@ -28,8 +32,6 @@ #include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep // clang-format on -namespace nostd = opentelemetry::nostd; - OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { @@ -59,7 +61,7 @@ struct InstrumentationScopePointerEqual } // namespace void OtlpRecordableUtils::PopulateRequest( - const nostd::span> &spans, + const opentelemetry::nostd::span> &spans, proto::collector::trace::v1::ExportTraceServiceRequest *request) noexcept { if (nullptr == request) @@ -119,7 +121,7 @@ void OtlpRecordableUtils::PopulateRequest( } void OtlpRecordableUtils::PopulateRequest( - const nostd::span> &logs, + const opentelemetry::nostd::span> &logs, proto::collector::logs::v1::ExportLogsServiceRequest *request) noexcept { if (nullptr == request) diff --git a/exporters/zipkin/include/opentelemetry/exporters/zipkin/recordable.h b/exporters/zipkin/include/opentelemetry/exporters/zipkin/recordable.h index 09955711e3..0331178f2a 100644 --- a/exporters/zipkin/include/opentelemetry/exporters/zipkin/recordable.h +++ b/exporters/zipkin/include/opentelemetry/exporters/zipkin/recordable.h @@ -3,8 +3,22 @@ #pragma once +#include +#include + #include "nlohmann/json.hpp" + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_flags.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/zipkin/include/opentelemetry/exporters/zipkin/zipkin_exporter.h b/exporters/zipkin/include/opentelemetry/exporters/zipkin/zipkin_exporter.h index effa2dfe75..19e7af9cf6 100644 --- a/exporters/zipkin/include/opentelemetry/exporters/zipkin/zipkin_exporter.h +++ b/exporters/zipkin/include/opentelemetry/exporters/zipkin/zipkin_exporter.h @@ -3,16 +3,20 @@ #pragma once -#include "opentelemetry/exporters/zipkin/zipkin_exporter_options.h" -#include "opentelemetry/ext/http/client/http_client_factory.h" -#include "opentelemetry/ext/http/common/url_parser.h" -#include "opentelemetry/sdk/common/env_variables.h" -#include "opentelemetry/sdk/trace/exporter.h" -#include "opentelemetry/sdk/trace/span_data.h" +#include +#include +#include #include "nlohmann/json.hpp" -#include +#include "opentelemetry/exporters/zipkin/zipkin_exporter_options.h" +#include "opentelemetry/ext/http/client/http_client.h" +#include "opentelemetry/ext/http/common/url_parser.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/zipkin/include/opentelemetry/exporters/zipkin/zipkin_exporter_factory.h b/exporters/zipkin/include/opentelemetry/exporters/zipkin/zipkin_exporter_factory.h index 3f84c6041b..b1564a7977 100644 --- a/exporters/zipkin/include/opentelemetry/exporters/zipkin/zipkin_exporter_factory.h +++ b/exporters/zipkin/include/opentelemetry/exporters/zipkin/zipkin_exporter_factory.h @@ -7,6 +7,7 @@ #include "opentelemetry/exporters/zipkin/zipkin_exporter_options.h" #include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/zipkin/src/recordable.cc b/exporters/zipkin/src/recordable.cc index ed43cb8a2d..c5aeede699 100644 --- a/exporters/zipkin/src/recordable.cc +++ b/exporters/zipkin/src/recordable.cc @@ -1,12 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + #include "opentelemetry/exporters/zipkin/recordable.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/empty_attributes.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" - -#include -#include +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/zipkin/src/zipkin_exporter.cc b/exporters/zipkin/src/zipkin_exporter.cc index a8a97b58af..3156919f5d 100644 --- a/exporters/zipkin/src/zipkin_exporter.cc +++ b/exporters/zipkin/src/zipkin_exporter.cc @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 #define _WINSOCKAPI_ // stops including winsock.h + #include "opentelemetry/exporters/zipkin/zipkin_exporter.h" -#include #include "opentelemetry/exporters/zipkin/recordable.h" #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/common/url_parser.h" -#include "opentelemetry/sdk_config.h" +#include "opentelemetry/version.h" namespace http_client = opentelemetry::ext::http::client; diff --git a/exporters/zipkin/src/zipkin_exporter_factory.cc b/exporters/zipkin/src/zipkin_exporter_factory.cc index 5003dbb0a0..edacb79842 100644 --- a/exporters/zipkin/src/zipkin_exporter_factory.cc +++ b/exporters/zipkin/src/zipkin_exporter_factory.cc @@ -4,6 +4,8 @@ #include "opentelemetry/exporters/zipkin/zipkin_exporter_factory.h" #include "opentelemetry/exporters/zipkin/zipkin_exporter.h" #include "opentelemetry/exporters/zipkin/zipkin_exporter_options.h" +#include "opentelemetry/ext/http/client/http_client.h" +#include "opentelemetry/version.h" namespace http_client = opentelemetry::ext::http::client; diff --git a/sdk/include/opentelemetry/sdk/common/global_log_handler.h b/sdk/include/opentelemetry/sdk/common/global_log_handler.h index 59a08e08a6..0b86041c3e 100644 --- a/sdk/include/opentelemetry/sdk/common/global_log_handler.h +++ b/sdk/include/opentelemetry/sdk/common/global_log_handler.h @@ -3,6 +3,7 @@ #pragma once +#include #include // IWYU pragma: keep #include #include diff --git a/sdk/src/logs/event_logger.cc b/sdk/src/logs/event_logger.cc index 6b0afacfaf..9a610ca9dc 100644 --- a/sdk/src/logs/event_logger.cc +++ b/sdk/src/logs/event_logger.cc @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include #include From d5632e4321cf46e7c2805019bd6c87fb87110dd2 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 22 Jun 2024 01:14:04 +0200 Subject: [PATCH 12/15] cleanup --- examples/common/foo_library/foo_library.cc | 1 - .../exporters/otlp/otlp_file_exporter_factory.h | 1 + exporters/otlp/src/otlp_file_client.cc | 7 +++---- exporters/otlp/src/otlp_file_exporter.cc | 6 ++++++ .../otlp/src/otlp_file_log_record_exporter.cc | 5 +++++ exporters/otlp/src/otlp_file_metric_exporter.cc | 7 +++++++ exporters/otlp/src/otlp_http_client.cc | 16 +++++++++++++--- exporters/otlp/src/otlp_http_exporter.cc | 12 +++++++++--- exporters/otlp/src/otlp_http_exporter_options.cc | 2 ++ .../otlp/src/otlp_http_log_record_exporter.cc | 8 ++++++++ .../src/otlp_http_log_record_exporter_options.cc | 2 ++ exporters/otlp/src/otlp_http_metric_exporter.cc | 7 +++++++ .../src/otlp_http_metric_exporter_options.cc | 3 +++ exporters/zipkin/src/recordable.cc | 13 ++++++++++++- exporters/zipkin/src/zipkin_exporter.cc | 1 + 15 files changed, 79 insertions(+), 12 deletions(-) diff --git a/examples/common/foo_library/foo_library.cc b/examples/common/foo_library/foo_library.cc index e336bc5e4c..6dd7792e48 100644 --- a/examples/common/foo_library/foo_library.cc +++ b/examples/common/foo_library/foo_library.cc @@ -3,7 +3,6 @@ #include "opentelemetry/context/context_value.h" #include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/version/version.h" #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/scope.h" diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter_factory.h index dc68609729..bf4ba3288f 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter_factory.h @@ -7,6 +7,7 @@ #include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" #include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/src/otlp_file_client.cc b/exporters/otlp/src/otlp_file_client.cc index 9678b22476..bd36a602c4 100644 --- a/exporters/otlp/src/otlp_file_client.cc +++ b/exporters/otlp/src/otlp_file_client.cc @@ -10,7 +10,7 @@ #endif // clang-format off -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep // clang-format on #include "google/protobuf/message.h" @@ -19,15 +19,14 @@ #include "nlohmann/json.hpp" // clang-format off -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep // clang-format on -#include "opentelemetry/common/macros.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/base64.h" #include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk_config.h" +#include "opentelemetry/version.h" #include #include diff --git a/exporters/otlp/src/otlp_file_exporter.cc b/exporters/otlp/src/otlp_file_exporter.cc index fe84da9b13..b98a6b2007 100644 --- a/exporters/otlp/src/otlp_file_exporter.cc +++ b/exporters/otlp/src/otlp_file_exporter.cc @@ -1,16 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include #include #include "opentelemetry/exporters/otlp/otlp_file_client.h" #include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_exporter.h" +#include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/version.h" // clang-format off diff --git a/exporters/otlp/src/otlp_file_log_record_exporter.cc b/exporters/otlp/src/otlp_file_log_record_exporter.cc index b4839b22d3..dd154ed599 100644 --- a/exporters/otlp/src/otlp_file_log_record_exporter.cc +++ b/exporters/otlp/src/otlp_file_log_record_exporter.cc @@ -1,6 +1,11 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter.h" #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" diff --git a/exporters/otlp/src/otlp_file_metric_exporter.cc b/exporters/otlp/src/otlp_file_metric_exporter.cc index 6ccd80af88..78aea66956 100644 --- a/exporters/otlp/src/otlp_file_metric_exporter.cc +++ b/exporters/otlp/src/otlp_file_metric_exporter.cc @@ -1,15 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include #include #include +#include "opentelemetry/exporters/otlp/otlp_file_client.h" #include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter.h" +#include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/version.h" // clang-format off diff --git a/exporters/otlp/src/otlp_http_client.cc b/exporters/otlp/src/otlp_http_client.cc index 318a847ebf..b9ccfada04 100644 --- a/exporters/otlp/src/otlp_http_client.cc +++ b/exporters/otlp/src/otlp_http_client.cc @@ -3,12 +3,18 @@ #include #include +#include #include +#include +#include #include +#include #include +#include #include #include #include +#include #include #include @@ -20,25 +26,29 @@ #include "nlohmann/json.hpp" #include "opentelemetry/common/timestamp.h" +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_http_client.h" +#include "opentelemetry/ext/http/client/http_client.h" #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/common/url_parser.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/base64.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/version.h" // clang-format off -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include "google/protobuf/message.h" -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep // clang-format on #ifdef GetMessage # undef GetMessage #endif -namespace nostd = opentelemetry::nostd; namespace http_client = opentelemetry::ext::http::client; OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/src/otlp_http_exporter.cc b/exporters/otlp/src/otlp_http_exporter.cc index 67ca5854bb..f740a0babf 100644 --- a/exporters/otlp/src/otlp_http_exporter.cc +++ b/exporters/otlp/src/otlp_http_exporter.cc @@ -1,18 +1,25 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include #include #include #include #include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http_client.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter.h" +#include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/span.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/version.h" // clang-format off @@ -22,8 +29,6 @@ #include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep // clang-format on -namespace nostd = opentelemetry::nostd; - OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { @@ -86,7 +91,8 @@ std::unique_ptr OtlpHttpExporter::MakeRec } opentelemetry::sdk::common::ExportResult OtlpHttpExporter::Export( - const nostd::span> &spans) noexcept + const opentelemetry::nostd::span> + &spans) noexcept { if (http_client_->IsShutdown()) { diff --git a/exporters/otlp/src/otlp_http_exporter_options.cc b/exporters/otlp/src/otlp_http_exporter_options.cc index 4dfe4d6a9f..753efcb481 100644 --- a/exporters/otlp/src/otlp_http_exporter_options.cc +++ b/exporters/otlp/src/otlp_http_exporter_options.cc @@ -4,6 +4,8 @@ #include #include +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" #include "opentelemetry/version.h" diff --git a/exporters/otlp/src/otlp_http_log_record_exporter.cc b/exporters/otlp/src/otlp_http_log_record_exporter.cc index 478fb66096..bd76bd10bd 100644 --- a/exporters/otlp/src/otlp_http_log_record_exporter.cc +++ b/exporters/otlp/src/otlp_http_log_record_exporter.cc @@ -1,18 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include #include #include #include #include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http_client.h" #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h" +#include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/span.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/version.h" // clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep diff --git a/exporters/otlp/src/otlp_http_log_record_exporter_options.cc b/exporters/otlp/src/otlp_http_log_record_exporter_options.cc index 26a18a5969..08a04cfa80 100644 --- a/exporters/otlp/src/otlp_http_log_record_exporter_options.cc +++ b/exporters/otlp/src/otlp_http_log_record_exporter_options.cc @@ -4,6 +4,8 @@ #include #include +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h" #include "opentelemetry/version.h" diff --git a/exporters/otlp/src/otlp_http_metric_exporter.cc b/exporters/otlp/src/otlp_http_metric_exporter.cc index 7677e1e32d..18b4ed0712 100644 --- a/exporters/otlp/src/otlp_http_metric_exporter.cc +++ b/exporters/otlp/src/otlp_http_metric_exporter.cc @@ -1,7 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include #include #include @@ -9,10 +11,15 @@ #include #include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http_client.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter.h" +#include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/version.h" // clang-format off diff --git a/exporters/otlp/src/otlp_http_metric_exporter_options.cc b/exporters/otlp/src/otlp_http_metric_exporter_options.cc index 3ecc20b1b9..66d65fa54b 100644 --- a/exporters/otlp/src/otlp_http_metric_exporter_options.cc +++ b/exporters/otlp/src/otlp_http_metric_exporter_options.cc @@ -4,7 +4,10 @@ #include #include +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" +#include "opentelemetry/exporters/otlp/otlp_preferred_temporality.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/zipkin/src/recordable.cc b/exporters/zipkin/src/recordable.cc index c5aeede699..69899e7fad 100644 --- a/exporters/zipkin/src/recordable.cc +++ b/exporters/zipkin/src/recordable.cc @@ -2,19 +2,30 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include #include #include #include #include #include +#include "nlohmann/json.hpp" + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/zipkin/recordable.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/attribute_utils.h" -#include "opentelemetry/sdk/common/empty_attributes.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_flags.h" #include "opentelemetry/trace/trace_id.h" #include "opentelemetry/version.h" diff --git a/exporters/zipkin/src/zipkin_exporter.cc b/exporters/zipkin/src/zipkin_exporter.cc index 3156919f5d..e92999b26a 100644 --- a/exporters/zipkin/src/zipkin_exporter.cc +++ b/exporters/zipkin/src/zipkin_exporter.cc @@ -7,6 +7,7 @@ #include "opentelemetry/exporters/zipkin/recordable.h" #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/common/url_parser.h" +#include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/version.h" namespace http_client = opentelemetry::ext::http::client; From 716a354ba180b882446b019f80ec11a4bc18c61b Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 22 Jun 2024 01:53:27 +0200 Subject: [PATCH 13/15] cleanup --- api/include/opentelemetry/std/shared_ptr.h | 2 +- examples/batch/main.cc | 4 +-- examples/multithreaded/main.cc | 4 +-- examples/otlp/file_log_main.cc | 21 ++++++++++----- examples/otlp/file_main.cc | 14 +++++++--- examples/otlp/file_metric_main.cc | 27 ++++++++++++------- examples/otlp/http_log_main.cc | 19 ++++++++++--- examples/otlp/http_main.cc | 12 +++++++-- examples/otlp/http_metric_main.cc | 24 ++++++++++++----- examples/plugin/plugin/tracer.cc | 1 - examples/zipkin/main.cc | 10 +++++++ .../otlp/src/otlp_file_log_record_exporter.cc | 7 +++++ exporters/zipkin/src/zipkin_exporter.cc | 6 ++++- functional/otlp/func_http_main.cc | 20 +++++++++++--- 14 files changed, 125 insertions(+), 46 deletions(-) diff --git a/api/include/opentelemetry/std/shared_ptr.h b/api/include/opentelemetry/std/shared_ptr.h index 0ca860476e..8b855b08c6 100644 --- a/api/include/opentelemetry/std/shared_ptr.h +++ b/api/include/opentelemetry/std/shared_ptr.h @@ -5,7 +5,7 @@ // IWYU pragma: private, include "opentelemetry/nostd/shared_ptr.h" -#include +#include // IWYU pragma: export #include "opentelemetry/version.h" diff --git a/examples/batch/main.cc b/examples/batch/main.cc index 2a7fba4630..cfd0895888 100644 --- a/examples/batch/main.cc +++ b/examples/batch/main.cc @@ -11,7 +11,6 @@ #include #include "opentelemetry/exporters/ostream/span_exporter_factory.h" -#include "opentelemetry/nostd/detail/decay.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/batch_span_processor_factory.h" @@ -30,7 +29,6 @@ namespace trace_api = opentelemetry::trace; namespace resource = opentelemetry::sdk::resource; namespace trace_sdk = opentelemetry::sdk::trace; namespace trace_exporter = opentelemetry::exporter::trace; -namespace nostd = opentelemetry::nostd; namespace { @@ -69,7 +67,7 @@ void CleanupTracer() trace_api::Provider::SetTracerProvider(none); } -nostd::shared_ptr get_tracer() +opentelemetry::nostd::shared_ptr get_tracer() { auto provider = trace_api::Provider::GetTracerProvider(); return provider->GetTracer("foo_library"); diff --git a/examples/multithreaded/main.cc b/examples/multithreaded/main.cc index 9dd76647c5..b38714e371 100644 --- a/examples/multithreaded/main.cc +++ b/examples/multithreaded/main.cc @@ -9,7 +9,6 @@ #include #include "opentelemetry/exporters/ostream/span_exporter_factory.h" -#include "opentelemetry/nostd/detail/decay.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/processor.h" @@ -25,7 +24,6 @@ namespace trace_api = opentelemetry::trace; namespace trace_sdk = opentelemetry::sdk::trace; -namespace nostd = opentelemetry::nostd; namespace { @@ -46,7 +44,7 @@ void CleanupTracer() trace_api::Provider::SetTracerProvider(none); } -nostd::shared_ptr get_tracer() +opentelemetry::nostd::shared_ptr get_tracer() { auto provider = trace_api::Provider::GetTracerProvider(); return provider->GetTracer("foo_library"); diff --git a/examples/otlp/file_log_main.cc b/examples/otlp/file_log_main.cc index 9254c9947f..990193e514 100644 --- a/examples/otlp/file_log_main.cc +++ b/examples/otlp/file_log_main.cc @@ -1,27 +1,34 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + #include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter_options.h" +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/logs/logger_provider.h" #include "opentelemetry/logs/provider.h" -#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/sdk/logs/logger_provider.h" #include "opentelemetry/sdk/logs/logger_provider_factory.h" -#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/logs/simple_log_record_processor_factory.h" -#include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" - -#include -#include -#include +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/logs_foo_library/foo_library.h" diff --git a/examples/otlp/file_main.cc b/examples/otlp/file_main.cc index 13db0e4ad1..8d4971a0fe 100644 --- a/examples/otlp/file_main.cc +++ b/examples/otlp/file_main.cc @@ -1,16 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_exporter_factory.h" +#include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" - -#include -#include -#include +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/foo_library/foo_library.h" diff --git a/examples/otlp/file_metric_main.cc b/examples/otlp/file_metric_main.cc index b99d77a609..e084014ea2 100644 --- a/examples/otlp/file_metric_main.cc +++ b/examples/otlp/file_metric_main.cc @@ -1,21 +1,28 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_factory.h" +#include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_options.h" +#include "opentelemetry/metrics/meter_provider.h" +#include "opentelemetry/metrics/observer_result.h" #include "opentelemetry/metrics/provider.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h" -#include "opentelemetry/sdk/metrics/meter.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" +#include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/metrics/meter_context_factory.h" -#include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/meter_provider_factory.h" - -#include -#include -#include -#include -#include +#include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" +#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/metrics_foo_library/foo_library.h" diff --git a/examples/otlp/http_log_main.cc b/examples/otlp/http_log_main.cc index e2b219de1c..7e28a9b4df 100644 --- a/examples/otlp/http_log_main.cc +++ b/examples/otlp/http_log_main.cc @@ -1,23 +1,34 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_factory.h" +#include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h" +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/logs/logger_provider.h" #include "opentelemetry/logs/provider.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/logs/logger_provider.h" #include "opentelemetry/sdk/logs/logger_provider_factory.h" -#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/logs/simple_log_record_processor_factory.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" - -#include -#include +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/logs_foo_library/foo_library.h" diff --git a/examples/otlp/http_main.cc b/examples/otlp/http_main.cc index 9ad476bd47..ff6b4621a3 100644 --- a/examples/otlp/http_main.cc +++ b/examples/otlp/http_main.cc @@ -1,16 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" - -#include +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/foo_library/foo_library.h" diff --git a/examples/otlp/http_metric_main.cc b/examples/otlp/http_metric_main.cc index f33d57772f..6de006051b 100644 --- a/examples/otlp/http_metric_main.cc +++ b/examples/otlp/http_metric_main.cc @@ -1,20 +1,30 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/exporters/otlp/otlp_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" +#include "opentelemetry/metrics/meter_provider.h" +#include "opentelemetry/metrics/observer_result.h" #include "opentelemetry/metrics/provider.h" #include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h" -#include "opentelemetry/sdk/metrics/meter.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" +#include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/metrics/meter_context_factory.h" -#include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/meter_provider_factory.h" - -#include -#include +#include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" +#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/metrics_foo_library/foo_library.h" diff --git a/examples/plugin/plugin/tracer.cc b/examples/plugin/plugin/tracer.cc index faf3f036e5..c205995037 100644 --- a/examples/plugin/plugin/tracer.cc +++ b/examples/plugin/plugin/tracer.cc @@ -10,7 +10,6 @@ #include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/timestamp.h" #include "opentelemetry/context/context_value.h" -#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_metadata.h" #include "tracer.h" diff --git a/examples/zipkin/main.cc b/examples/zipkin/main.cc index 0052cd430e..6727f61e5e 100644 --- a/examples/zipkin/main.cc +++ b/examples/zipkin/main.cc @@ -1,12 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + #include "opentelemetry/exporters/zipkin/zipkin_exporter_factory.h" +#include "opentelemetry/exporters/zipkin/zipkin_exporter_options.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" +#include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/foo_library/foo_library.h" diff --git a/exporters/otlp/src/otlp_file_log_record_exporter.cc b/exporters/otlp/src/otlp_file_log_record_exporter.cc index dd154ed599..7df1c70b29 100644 --- a/exporters/otlp/src/otlp_file_log_record_exporter.cc +++ b/exporters/otlp/src/otlp_file_log_record_exporter.cc @@ -1,15 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include #include +#include "opentelemetry/exporters/otlp/otlp_file_client.h" #include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter.h" +#include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/version.h" // clang-format off diff --git a/exporters/zipkin/src/zipkin_exporter.cc b/exporters/zipkin/src/zipkin_exporter.cc index e92999b26a..8e9905c887 100644 --- a/exporters/zipkin/src/zipkin_exporter.cc +++ b/exporters/zipkin/src/zipkin_exporter.cc @@ -3,8 +3,12 @@ #define _WINSOCKAPI_ // stops including winsock.h -#include "opentelemetry/exporters/zipkin/zipkin_exporter.h" +#include +#include +#include + #include "opentelemetry/exporters/zipkin/recordable.h" +#include "opentelemetry/exporters/zipkin/zipkin_exporter.h" #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/common/url_parser.h" #include "opentelemetry/sdk/common/global_log_handler.h" diff --git a/functional/otlp/func_http_main.cc b/functional/otlp/func_http_main.cc index 9cd3585668..bcee04c7d7 100644 --- a/functional/otlp/func_http_main.cc +++ b/functional/otlp/func_http_main.cc @@ -1,16 +1,30 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/exporters/otlp/otlp_environment.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" +#include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" - -#include -#include +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/trace/tracer_provider.h" namespace trace = opentelemetry::trace; namespace trace_sdk = opentelemetry::sdk::trace; From 2a8c002863a1c184107b4af1bbacb0dd23d9f108 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 22 Jun 2024 02:28:20 +0200 Subject: [PATCH 14/15] cleanup --- api/include/opentelemetry/std/unique_ptr.h | 2 +- examples/batch/main.cc | 1 - .../common/logs_foo_library/foo_library.cc | 5 ++- .../common/metrics_foo_library/foo_library.cc | 36 ++++++++++--------- examples/multithreaded/main.cc | 1 - examples/otlp/file_log_main.cc | 2 -- examples/otlp/file_main.cc | 1 - examples/otlp/file_metric_main.cc | 2 -- examples/otlp/http_log_main.cc | 1 - examples/otlp/http_main.cc | 1 - examples/otlp/http_metric_main.cc | 2 -- examples/plugin/plugin/tracer.h | 1 - examples/zipkin/main.cc | 1 - exporters/ostream/src/span_exporter.cc | 1 - exporters/otlp/src/otlp_http_client.cc | 4 ++- exporters/otlp/src/otlp_recordable.cc | 1 - exporters/zipkin/src/zipkin_exporter.cc | 11 ++++++ ext/src/http/client/curl/http_client_curl.cc | 1 - functional/otlp/func_http_main.cc | 1 - .../sdk/common/global_log_handler.h | 1 - sdk/src/logs/event_logger.cc | 1 - sdk/src/logs/logger.cc | 1 - sdk/src/logs/logger_provider.cc | 1 - sdk/src/metrics/meter.cc | 1 - sdk/src/metrics/meter_provider.cc | 1 - sdk/src/metrics/state/observable_registry.cc | 1 - sdk/src/trace/tracer.cc | 1 - sdk/src/trace/tracer_provider.cc | 1 - 28 files changed, 36 insertions(+), 48 deletions(-) diff --git a/api/include/opentelemetry/std/unique_ptr.h b/api/include/opentelemetry/std/unique_ptr.h index e1a0490742..4b25b7c381 100644 --- a/api/include/opentelemetry/std/unique_ptr.h +++ b/api/include/opentelemetry/std/unique_ptr.h @@ -5,7 +5,7 @@ // IWYU pragma: private, include "opentelemetry/nostd/unique_ptr.h" -#include +#include // IWYU pragma: export #include "opentelemetry/version.h" diff --git a/examples/batch/main.cc b/examples/batch/main.cc index cfd0895888..677feca424 100644 --- a/examples/batch/main.cc +++ b/examples/batch/main.cc @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/common/logs_foo_library/foo_library.cc b/examples/common/logs_foo_library/foo_library.cc index 23402563c6..510c3956d4 100644 --- a/examples/common/logs_foo_library/foo_library.cc +++ b/examples/common/logs_foo_library/foo_library.cc @@ -16,17 +16,16 @@ namespace logs = opentelemetry::logs; namespace trace = opentelemetry::trace; -namespace nostd = opentelemetry::nostd; namespace { -nostd::shared_ptr get_tracer() +opentelemetry::nostd::shared_ptr get_tracer() { auto provider = trace::Provider::GetTracerProvider(); return provider->GetTracer("foo_library", OPENTELEMETRY_SDK_VERSION); } -nostd::shared_ptr get_logger() +opentelemetry::nostd::shared_ptr get_logger() { auto provider = logs::Provider::GetLoggerProvider(); return provider->GetLogger("foo_library_logger", "foo_library"); diff --git a/examples/common/metrics_foo_library/foo_library.cc b/examples/common/metrics_foo_library/foo_library.cc index dd5f23297b..c4be2b530f 100644 --- a/examples/common/metrics_foo_library/foo_library.cc +++ b/examples/common/metrics_foo_library/foo_library.cc @@ -17,17 +17,17 @@ #include "opentelemetry/metrics/meter_provider.h" #include "opentelemetry/metrics/observer_result.h" #include "opentelemetry/metrics/provider.h" +#include "opentelemetry/metrics/sync_instruments.h" #include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/nostd/variant.h" -namespace nostd = opentelemetry::nostd; namespace metrics_api = opentelemetry::metrics; namespace { -static nostd::shared_ptr double_observable_counter; +static opentelemetry::nostd::shared_ptr + double_observable_counter; std::map get_random_attr() { @@ -45,13 +45,15 @@ class MeasurementFetcher public: static void Fetcher(opentelemetry::metrics::ObserverResult observer_result, void * /* state */) { - if (nostd::holds_alternative< - nostd::shared_ptr>>(observer_result)) + if (opentelemetry::nostd::holds_alternative< + opentelemetry::nostd::shared_ptr>>( + observer_result)) { double random_incr = (rand() % 5) + 1.1; value_ += random_incr; std::map labels = get_random_attr(); - nostd::get>>( + opentelemetry::nostd::get< + opentelemetry::nostd::shared_ptr>>( observer_result) ->Observe(value_, labels); } @@ -63,10 +65,10 @@ double MeasurementFetcher::value_ = 0.0; void foo_library::counter_example(const std::string &name) { - std::string counter_name = name + "_counter"; - auto provider = metrics_api::Provider::GetMeterProvider(); - nostd::shared_ptr meter = provider->GetMeter(name, "1.2.0"); - auto double_counter = meter->CreateDoubleCounter(counter_name); + std::string counter_name = name + "_counter"; + auto provider = metrics_api::Provider::GetMeterProvider(); + opentelemetry::nostd::shared_ptr meter = provider->GetMeter(name, "1.2.0"); + auto double_counter = meter->CreateDoubleCounter(counter_name); for (uint32_t i = 0; i < 20; ++i) { @@ -78,10 +80,10 @@ void foo_library::counter_example(const std::string &name) void foo_library::observable_counter_example(const std::string &name) { - std::string counter_name = name + "_observable_counter"; - auto provider = metrics_api::Provider::GetMeterProvider(); - nostd::shared_ptr meter = provider->GetMeter(name, "1.2.0"); - double_observable_counter = meter->CreateDoubleObservableCounter(counter_name); + std::string counter_name = name + "_observable_counter"; + auto provider = metrics_api::Provider::GetMeterProvider(); + opentelemetry::nostd::shared_ptr meter = provider->GetMeter(name, "1.2.0"); + double_observable_counter = meter->CreateDoubleObservableCounter(counter_name); double_observable_counter->AddCallback(MeasurementFetcher::Fetcher, nullptr); for (uint32_t i = 0; i < 20; ++i) { @@ -91,9 +93,9 @@ void foo_library::observable_counter_example(const std::string &name) void foo_library::histogram_example(const std::string &name) { - std::string histogram_name = name + "_histogram"; - auto provider = metrics_api::Provider::GetMeterProvider(); - nostd::shared_ptr meter = provider->GetMeter(name, "1.2.0"); + std::string histogram_name = name + "_histogram"; + auto provider = metrics_api::Provider::GetMeterProvider(); + opentelemetry::nostd::shared_ptr meter = provider->GetMeter(name, "1.2.0"); auto histogram_counter = meter->CreateDoubleHistogram(histogram_name, "des", "unit"); auto context = opentelemetry::context::Context{}; for (uint32_t i = 0; i < 20; ++i) diff --git a/examples/multithreaded/main.cc b/examples/multithreaded/main.cc index b38714e371..d92a4ab2ac 100644 --- a/examples/multithreaded/main.cc +++ b/examples/multithreaded/main.cc @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include #include #include #include diff --git a/examples/otlp/file_log_main.cc b/examples/otlp/file_log_main.cc index 990193e514..30eb71cc2b 100644 --- a/examples/otlp/file_log_main.cc +++ b/examples/otlp/file_log_main.cc @@ -3,7 +3,6 @@ #include #include -#include #include #include @@ -28,7 +27,6 @@ #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/tracer_provider.h" -#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/logs_foo_library/foo_library.h" diff --git a/examples/otlp/file_main.cc b/examples/otlp/file_main.cc index 8d4971a0fe..243ad44428 100644 --- a/examples/otlp/file_main.cc +++ b/examples/otlp/file_main.cc @@ -16,7 +16,6 @@ #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/tracer_provider.h" -#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/foo_library/foo_library.h" diff --git a/examples/otlp/file_metric_main.cc b/examples/otlp/file_metric_main.cc index e084014ea2..ce259005be 100644 --- a/examples/otlp/file_metric_main.cc +++ b/examples/otlp/file_metric_main.cc @@ -12,7 +12,6 @@ #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_options.h" #include "opentelemetry/metrics/meter_provider.h" -#include "opentelemetry/metrics/observer_result.h" #include "opentelemetry/metrics/provider.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" @@ -22,7 +21,6 @@ #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" -#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/metrics_foo_library/foo_library.h" diff --git a/examples/otlp/http_log_main.cc b/examples/otlp/http_log_main.cc index 7e28a9b4df..38aa009d04 100644 --- a/examples/otlp/http_log_main.cc +++ b/examples/otlp/http_log_main.cc @@ -28,7 +28,6 @@ #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/tracer_provider.h" -#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/logs_foo_library/foo_library.h" diff --git a/examples/otlp/http_main.cc b/examples/otlp/http_main.cc index ff6b4621a3..6217bdcb34 100644 --- a/examples/otlp/http_main.cc +++ b/examples/otlp/http_main.cc @@ -18,7 +18,6 @@ #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/tracer_provider.h" -#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/foo_library/foo_library.h" diff --git a/examples/otlp/http_metric_main.cc b/examples/otlp/http_metric_main.cc index 6de006051b..53f5fe38bc 100644 --- a/examples/otlp/http_metric_main.cc +++ b/examples/otlp/http_metric_main.cc @@ -13,7 +13,6 @@ #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" #include "opentelemetry/metrics/meter_provider.h" -#include "opentelemetry/metrics/observer_result.h" #include "opentelemetry/metrics/provider.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h" @@ -24,7 +23,6 @@ #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" -#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/metrics_foo_library/foo_library.h" diff --git a/examples/plugin/plugin/tracer.h b/examples/plugin/plugin/tracer.h index bb933d3d9b..92012fa4a5 100644 --- a/examples/plugin/plugin/tracer.h +++ b/examples/plugin/plugin/tracer.h @@ -4,7 +4,6 @@ #pragma once #include -#include #include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/nostd/shared_ptr.h" diff --git a/examples/zipkin/main.cc b/examples/zipkin/main.cc index 6727f61e5e..ac9e454580 100644 --- a/examples/zipkin/main.cc +++ b/examples/zipkin/main.cc @@ -16,7 +16,6 @@ #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/tracer_provider.h" -#include "opentelemetry/version.h" #ifdef BAZEL_BUILD # include "examples/common/foo_library/foo_library.h" diff --git a/exporters/ostream/src/span_exporter.cc b/exporters/ostream/src/span_exporter.cc index d3f5093b40..9437ae561a 100644 --- a/exporters/ostream/src/span_exporter.cc +++ b/exporters/ostream/src/span_exporter.cc @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/exporters/otlp/src/otlp_http_client.cc b/exporters/otlp/src/otlp_http_client.cc index b9ccfada04..03eb5fb434 100644 --- a/exporters/otlp/src/otlp_http_client.cc +++ b/exporters/otlp/src/otlp_http_client.cc @@ -41,7 +41,9 @@ // clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep -#include "google/protobuf/message.h" +#include +#include +#include #include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep // clang-format on diff --git a/exporters/otlp/src/otlp_recordable.cc b/exporters/otlp/src/otlp_recordable.cc index 3754964f86..356472fb48 100644 --- a/exporters/otlp/src/otlp_recordable.cc +++ b/exporters/otlp/src/otlp_recordable.cc @@ -3,7 +3,6 @@ #include #include -#include #include #include "opentelemetry/common/attribute_value.h" diff --git a/exporters/zipkin/src/zipkin_exporter.cc b/exporters/zipkin/src/zipkin_exporter.cc index 8e9905c887..3b65b924f5 100644 --- a/exporters/zipkin/src/zipkin_exporter.cc +++ b/exporters/zipkin/src/zipkin_exporter.cc @@ -4,14 +4,25 @@ #define _WINSOCKAPI_ // stops including winsock.h #include +#include +#include +#include +#include #include #include +#include "nlohmann/json.hpp" + #include "opentelemetry/exporters/zipkin/recordable.h" #include "opentelemetry/exporters/zipkin/zipkin_exporter.h" +#include "opentelemetry/exporters/zipkin/zipkin_exporter_options.h" +#include "opentelemetry/ext/http/client/http_client.h" #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/common/url_parser.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/version.h" namespace http_client = opentelemetry::ext::http::client; diff --git a/ext/src/http/client/curl/http_client_curl.cc b/ext/src/http/client/curl/http_client_curl.cc index 07464a8dd6..38ca2e7348 100644 --- a/ext/src/http/client/curl/http_client_curl.cc +++ b/ext/src/http/client/curl/http_client_curl.cc @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/functional/otlp/func_http_main.cc b/functional/otlp/func_http_main.cc index bcee04c7d7..32f4a96d35 100644 --- a/functional/otlp/func_http_main.cc +++ b/functional/otlp/func_http_main.cc @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/sdk/include/opentelemetry/sdk/common/global_log_handler.h b/sdk/include/opentelemetry/sdk/common/global_log_handler.h index 0b86041c3e..59a08e08a6 100644 --- a/sdk/include/opentelemetry/sdk/common/global_log_handler.h +++ b/sdk/include/opentelemetry/sdk/common/global_log_handler.h @@ -3,7 +3,6 @@ #pragma once -#include #include // IWYU pragma: keep #include #include diff --git a/sdk/src/logs/event_logger.cc b/sdk/src/logs/event_logger.cc index 9a610ca9dc..6b0afacfaf 100644 --- a/sdk/src/logs/event_logger.cc +++ b/sdk/src/logs/event_logger.cc @@ -1,7 +1,6 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include #include #include diff --git a/sdk/src/logs/logger.cc b/sdk/src/logs/logger.cc index d3555ba4ec..e9935c5107 100644 --- a/sdk/src/logs/logger.cc +++ b/sdk/src/logs/logger.cc @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include #include #include diff --git a/sdk/src/logs/logger_provider.cc b/sdk/src/logs/logger_provider.cc index 0530b86bd1..1eaa0d186e 100644 --- a/sdk/src/logs/logger_provider.cc +++ b/sdk/src/logs/logger_provider.cc @@ -3,7 +3,6 @@ #include #include -#include #include #include #include diff --git a/sdk/src/metrics/meter.cc b/sdk/src/metrics/meter.cc index f472ac726e..8b4413113b 100644 --- a/sdk/src/metrics/meter.cc +++ b/sdk/src/metrics/meter.cc @@ -3,7 +3,6 @@ #include #include -#include #include #include #include diff --git a/sdk/src/metrics/meter_provider.cc b/sdk/src/metrics/meter_provider.cc index 0efab63cb9..6ddba6aa7c 100644 --- a/sdk/src/metrics/meter_provider.cc +++ b/sdk/src/metrics/meter_provider.cc @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include #include #include diff --git a/sdk/src/metrics/state/observable_registry.cc b/sdk/src/metrics/state/observable_registry.cc index 4da46ddfe3..8db11d4605 100644 --- a/sdk/src/metrics/state/observable_registry.cc +++ b/sdk/src/metrics/state/observable_registry.cc @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/sdk/src/trace/tracer.cc b/sdk/src/trace/tracer.cc index ce402e4f50..fd02548c7b 100644 --- a/sdk/src/trace/tracer.cc +++ b/sdk/src/trace/tracer.cc @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/sdk/src/trace/tracer_provider.cc b/sdk/src/trace/tracer_provider.cc index 9791f1c3cd..9440e3d469 100644 --- a/sdk/src/trace/tracer_provider.cc +++ b/sdk/src/trace/tracer_provider.cc @@ -3,7 +3,6 @@ #include #include -#include #include #include #include From aea170bf804c06c81cb9d108f0bc1b7f77152b27 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 22 Jun 2024 02:45:15 +0200 Subject: [PATCH 15/15] cleanup --- examples/plugin/load/main.cc | 2 +- examples/plugin/plugin/factory_impl.cc | 1 - examples/plugin/plugin/tracer.cc | 1 - exporters/zipkin/src/zipkin_exporter.cc | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/plugin/load/main.cc b/examples/plugin/load/main.cc index 589f70c2af..81d5221372 100644 --- a/examples/plugin/load/main.cc +++ b/examples/plugin/load/main.cc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include +#include // IWYU pragma: keep #include #include #include diff --git a/examples/plugin/plugin/factory_impl.cc b/examples/plugin/plugin/factory_impl.cc index 4d74bd6062..6eaa4aa4f1 100644 --- a/examples/plugin/plugin/factory_impl.cc +++ b/examples/plugin/plugin/factory_impl.cc @@ -1,7 +1,6 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include #include #include diff --git a/examples/plugin/plugin/tracer.cc b/examples/plugin/plugin/tracer.cc index c205995037..5361197584 100644 --- a/examples/plugin/plugin/tracer.cc +++ b/examples/plugin/plugin/tracer.cc @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include #include #include #include diff --git a/exporters/zipkin/src/zipkin_exporter.cc b/exporters/zipkin/src/zipkin_exporter.cc index 3b65b924f5..e6d3ce8b26 100644 --- a/exporters/zipkin/src/zipkin_exporter.cc +++ b/exporters/zipkin/src/zipkin_exporter.cc @@ -4,7 +4,6 @@ #define _WINSOCKAPI_ // stops including winsock.h #include -#include #include #include #include