From 6dbfdb52ebca82d8705392fe88dadd9c133374e4 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 6 Jul 2024 17:16:02 +0200 Subject: [PATCH] [Code health] include-what-you-use cleanup, part 2 (#2704) --- .github/workflows/iwyu.yml | 8 +++ api/include/opentelemetry/std/shared_ptr.h | 4 +- api/include/opentelemetry/std/span.h | 2 + api/include/opentelemetry/std/string_view.h | 2 + api/include/opentelemetry/std/type_traits.h | 2 + api/include/opentelemetry/std/unique_ptr.h | 4 +- api/include/opentelemetry/std/utility.h | 2 + api/include/opentelemetry/std/variant.h | 2 + cmake/opentelemetry-proto.cmake | 6 ++ examples/batch/main.cc | 5 +- examples/common/foo_library/foo_library.cc | 1 - .../common/logs_foo_library/foo_library.cc | 5 +- .../common/metrics_foo_library/foo_library.cc | 36 ++++++------ examples/multithreaded/main.cc | 5 +- examples/otlp/file_log_main.cc | 19 +++--- examples/otlp/file_main.cc | 13 +++-- examples/otlp/file_metric_main.cc | 25 ++++---- examples/otlp/http_log_main.cc | 18 ++++-- examples/otlp/http_main.cc | 11 +++- examples/otlp/http_metric_main.cc | 22 ++++--- examples/plugin/load/main.cc | 2 +- examples/plugin/plugin/factory_impl.cc | 1 - examples/plugin/plugin/tracer.cc | 2 - examples/plugin/plugin/tracer.h | 1 - examples/zipkin/main.cc | 9 +++ exporters/ostream/src/span_exporter.cc | 1 - .../exporters/otlp/otlp_environment.h | 12 ++-- .../exporters/otlp/otlp_file_client.h | 9 +-- .../exporters/otlp/otlp_file_exporter.h | 13 +++-- .../otlp/otlp_file_exporter_factory.h | 1 + .../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 + .../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 ++--- .../otlp/otlp_http_metric_exporter_factory.h | 5 +- .../otlp/otlp_http_metric_exporter_options.h | 8 +-- .../exporters/otlp/otlp_metric_utils.h | 32 +++++++--- .../otlp/otlp_populate_attribute_utils.h | 31 ++++++++-- .../exporters/otlp/otlp_recordable.h | 22 +++++-- .../exporters/otlp/otlp_recordable_utils.h | 36 +++++++++--- exporters/otlp/src/otlp_environment.cc | 17 ++++-- exporters/otlp/src/otlp_file_client.cc | 7 +-- exporters/otlp/src/otlp_file_exporter.cc | 25 +++++--- .../otlp/src/otlp_file_log_record_exporter.cc | 24 ++++++-- .../otlp/src/otlp_file_metric_exporter.cc | 25 ++++++-- exporters/otlp/src/otlp_http_client.cc | 58 ++++++++++--------- exporters/otlp/src/otlp_http_exporter.cc | 32 +++++++--- .../otlp/src/otlp_http_exporter_options.cc | 9 +-- .../otlp/src/otlp_http_log_record_exporter.cc | 32 +++++++--- .../otlp_http_log_record_exporter_options.cc | 9 +-- .../otlp/src/otlp_http_metric_exporter.cc | 30 +++++++--- .../src/otlp_http_metric_exporter_options.cc | 10 ++-- exporters/otlp/src/otlp_log_recordable.cc | 19 ++++-- exporters/otlp/src/otlp_metric_utils.cc | 23 ++++++++ .../otlp/src/otlp_populate_attribute_utils.cc | 22 +++++++ exporters/otlp/src/otlp_recordable.cc | 30 +++++++++- exporters/otlp/src/otlp_recordable_utils.cc | 43 +++++++++----- exporters/otlp/test/otlp_recordable_test.cc | 6 ++ .../exporters/zipkin/recordable.h | 14 +++++ .../exporters/zipkin/zipkin_exporter.h | 18 +++--- .../zipkin/zipkin_exporter_factory.h | 1 + exporters/zipkin/src/recordable.cc | 27 ++++++++- exporters/zipkin/src/zipkin_exporter.cc | 21 ++++++- .../zipkin/src/zipkin_exporter_factory.cc | 2 + .../ext/http/client/curl/http_client_curl.h | 21 ++++--- ext/src/http/client/curl/http_client_curl.cc | 26 ++++++++- .../client/curl/http_client_factory_curl.cc | 2 + .../http/client/curl/http_operation_curl.cc | 21 ++++++- functional/otlp/func_http_main.cc | 19 +++++- sdk/src/logs/logger.cc | 1 - sdk/src/logs/logger_provider.cc | 2 - sdk/src/logs/readable_log_record.cc | 1 - sdk/src/metrics/meter.cc | 1 - sdk/src/metrics/meter_provider.cc | 2 - sdk/src/metrics/state/observable_registry.cc | 1 - sdk/src/trace/tracer.cc | 2 - sdk/src/trace/tracer_provider.cc | 2 - 86 files changed, 761 insertions(+), 338 deletions(-) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index 29b8274fbd..598f57e97e 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -36,10 +36,18 @@ jobs: TOPDIR=`pwd` 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 \ -DBUILD_W3CTRACECONTEXT_TEST=OFF \ + -DWITH_OTLP_GRPC=OFF \ + -DWITH_OTLP_HTTP=ON \ + -DWITH_OTLP_FILE=ON \ + -DWITH_OTLP_HTTP_COMPRESSION=ON \ + -DWITH_ZIPKIN=ON \ + -DWITH_PROMETHEUS=OFF \ .. - name: iwyu_tool diff --git a/api/include/opentelemetry/std/shared_ptr.h b/api/include/opentelemetry/std/shared_ptr.h index b1b99bd36c..8b855b08c6 100644 --- a/api/include/opentelemetry/std/shared_ptr.h +++ b/api/include/opentelemetry/std/shared_ptr.h @@ -3,7 +3,9 @@ #pragma once -#include +// IWYU pragma: private, include "opentelemetry/nostd/shared_ptr.h" + +#include // IWYU pragma: export #include "opentelemetry/version.h" 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/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/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/unique_ptr.h b/api/include/opentelemetry/std/unique_ptr.h index 1d7d9b1fc7..4b25b7c381 100644 --- a/api/include/opentelemetry/std/unique_ptr.h +++ b/api/include/opentelemetry/std/unique_ptr.h @@ -3,7 +3,9 @@ #pragma once -#include +// IWYU pragma: private, include "opentelemetry/nostd/unique_ptr.h" + +#include // IWYU pragma: export #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/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake index 19516c3b71..62197068e2 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 CXX_INCLUDE_WHAT_YOU_USE "" +) + if(WITH_ABSEIL) target_link_libraries(opentelemetry_proto PUBLIC absl::bad_variant_access) endif() diff --git a/examples/batch/main.cc b/examples/batch/main.cc index 2a7fba4630..677feca424 100644 --- a/examples/batch/main.cc +++ b/examples/batch/main.cc @@ -5,13 +5,11 @@ #include #include #include -#include #include #include #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 +28,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 +66,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/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/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 9dd76647c5..d92a4ab2ac 100644 --- a/examples/multithreaded/main.cc +++ b/examples/multithreaded/main.cc @@ -2,14 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include #include #include #include #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 +23,6 @@ namespace trace_api = opentelemetry::trace; namespace trace_sdk = opentelemetry::sdk::trace; -namespace nostd = opentelemetry::nostd; namespace { @@ -46,7 +43,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..30eb71cc2b 100644 --- a/examples/otlp/file_log_main.cc +++ b/examples/otlp/file_log_main.cc @@ -1,27 +1,32 @@ // 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_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" #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..243ad44428 100644 --- a/examples/otlp/file_main.cc +++ b/examples/otlp/file_main.cc @@ -1,16 +1,21 @@ // 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" #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..ce259005be 100644 --- a/examples/otlp/file_metric_main.cc +++ b/examples/otlp/file_metric_main.cc @@ -1,21 +1,26 @@ // 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/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" #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..38aa009d04 100644 --- a/examples/otlp/http_log_main.cc +++ b/examples/otlp/http_log_main.cc @@ -1,23 +1,33 @@ // 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" #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..6217bdcb34 100644 --- a/examples/otlp/http_main.cc +++ b/examples/otlp/http_main.cc @@ -1,16 +1,23 @@ // 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" #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..53f5fe38bc 100644 --- a/examples/otlp/http_metric_main.cc +++ b/examples/otlp/http_metric_main.cc @@ -1,20 +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_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/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" #ifdef BAZEL_BUILD # include "examples/common/metrics_foo_library/foo_library.h" 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 faf3f036e5..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 @@ -10,7 +9,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/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 0052cd430e..ac9e454580 100644 --- a/examples/zipkin/main.cc +++ b/examples/zipkin/main.cc @@ -1,12 +1,21 @@ // 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" #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/include/opentelemetry/exporters/otlp/otlp_environment.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h index 8b486a548f..74a222a9d0 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/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_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/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.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_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/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_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/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 a7af30bb73..276d9fc709 100644 --- a/exporters/otlp/src/otlp_environment.cc +++ b/exporters/otlp/src/otlp_environment.cc @@ -1,15 +1,20 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/kv_properties.h" #include "opentelemetry/exporters/otlp/otlp_environment.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" +#include "opentelemetry/version.h" -namespace nostd = opentelemetry::nostd; namespace sdk_common = opentelemetry::sdk::common; /* 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 816151719a..b98a6b2007 100644 --- a/exporters/otlp/src/otlp_file_exporter.cc +++ b/exporters/otlp/src/otlp_file_exporter.cc @@ -1,19 +1,30 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_file_exporter.h" +#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" -#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..7df1c70b29 100644 --- a/exporters/otlp/src/otlp_file_log_record_exporter.cc +++ b/exporters/otlp/src/otlp_file_log_record_exporter.cc @@ -1,18 +1,30 @@ // 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" -#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..78aea66956 100644 --- a/exporters/otlp/src/otlp_file_metric_exporter.cc +++ b/exporters/otlp/src/otlp_file_metric_exporter.cc @@ -1,17 +1,30 @@ // 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" -#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..03eb5fb434 100644 --- a/exporters/otlp/src/otlp_http_client.cc +++ b/exporters/otlp/src/otlp_http_client.cc @@ -1,7 +1,22 @@ // 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 +#include +#include +#include +#include +#include +#include #if defined(HAVE_GSL) # include @@ -9,42 +24,33 @@ # include #endif -#include "opentelemetry/ext/http/client/http_client_factory.h" -#include "opentelemetry/ext/http/common/url_parser.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/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/sdk_config.h" +#include "opentelemetry/version.h" -#include -#include -#include -#include -#include -#include -#include -#include +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include +#include +#include +#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 aa00c3f79a..f740a0babf 100644 --- a/exporters/otlp/src/otlp_http_exporter.cc +++ b/exporters/otlp/src/otlp_http_exporter.cc @@ -1,20 +1,33 @@ // 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" -#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" - -namespace nostd = opentelemetry::nostd; +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter @@ -78,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 d88b8d2e3d..753efcb481 100644 --- a/exporters/otlp/src/otlp_http_exporter_options.cc +++ b/exporters/otlp/src/otlp_http_exporter_options.cc @@ -1,13 +1,14 @@ // 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_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" +#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..bd76bd10bd 100644 --- a/exporters/otlp/src/otlp_http_log_record_exporter.cc +++ b/exporters/otlp/src/otlp_http_log_record_exporter.cc @@ -1,20 +1,33 @@ // 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" -#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 +95,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..08a04cfa80 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,14 @@ // 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_environment.h" +#include "opentelemetry/exporters/otlp/otlp_http.h" +#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..18b4ed0712 100644 --- a/exporters/otlp/src/otlp_http_metric_exporter.cc +++ b/exporters/otlp/src/otlp_http_metric_exporter.cc @@ -1,19 +1,33 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#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_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" -#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..66d65fa54b 100644 --- a/exporters/otlp/src/otlp_http_metric_exporter_options.cc +++ b/exporters/otlp/src/otlp_http_metric_exporter_options.cc @@ -1,13 +1,15 @@ // 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_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 namespace exporter { diff --git a/exporters/otlp/src/otlp_log_recordable.cc b/exporters/otlp/src/otlp_log_recordable.cc index 8acb4073d2..03c89626f2 100644 --- a/exporters/otlp/src/otlp_log_recordable.cc +++ b/exporters/otlp/src/otlp_log_recordable.cc @@ -1,14 +1,23 @@ // 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/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" - -namespace nostd = opentelemetry::nostd; +#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" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter @@ -216,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 e75b17ddd7..da162d117e 100644 --- a/exporters/otlp/src/otlp_metric_utils.cc +++ b/exporters/otlp/src/otlp_metric_utils.cc @@ -1,9 +1,32 @@ // 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/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 OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/src/otlp_populate_attribute_utils.cc b/exporters/otlp/src/otlp_populate_attribute_utils.cc index 69a284835a..a2ef2edafa 100644 --- a/exporters/otlp/src/otlp_populate_attribute_utils.cc +++ b/exporters/otlp/src/otlp_populate_attribute_utils.cc @@ -1,7 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#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 +#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..356472fb48 100644 --- a/exporters/otlp/src/otlp_recordable.cc +++ b/exporters/otlp/src/otlp_recordable.cc @@ -1,10 +1,36 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_recordable.h" +#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_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; diff --git a/exporters/otlp/src/otlp_recordable_utils.cc b/exporters/otlp/src/otlp_recordable_utils.cc index 59e4aadf4e..df29cca838 100644 --- a/exporters/otlp/src/otlp_recordable_utils.cc +++ b/exporters/otlp/src/otlp_recordable_utils.cc @@ -1,23 +1,36 @@ // 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 #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 - -namespace nostd = opentelemetry::nostd; +#include "opentelemetry/exporters/otlp/otlp_recordable_utils.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 +#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 OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter @@ -48,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) @@ -108,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/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 { 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..69899e7fad 100644 --- a/exporters/zipkin/src/recordable.cc +++ b/exporters/zipkin/src/recordable.cc @@ -1,12 +1,33 @@ // Copyright The OpenTelemetry Authors // 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/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" - -#include -#include +#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" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/zipkin/src/zipkin_exporter.cc b/exporters/zipkin/src/zipkin_exporter.cc index a8a97b58af..e6d3ce8b26 100644 --- a/exporters/zipkin/src/zipkin_exporter.cc +++ b/exporters/zipkin/src/zipkin_exporter.cc @@ -2,12 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 #define _WINSOCKAPI_ // stops including winsock.h -#include "opentelemetry/exporters/zipkin/zipkin_exporter.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/sdk_config.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/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/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..38ca2e7348 100644 --- a/ext/src/http/client/curl/http_client_curl.cc +++ b/ext/src/http/client/curl/http_client_curl.cc @@ -1,15 +1,35 @@ // 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 "opentelemetry/ext/http/client/curl/http_client_curl.h" -#include "opentelemetry/sdk/common/global_log_handler.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/version.h" #ifdef ENABLE_OTLP_COMPRESSION_PREVIEW # include +#else +# include "opentelemetry/sdk/common/global_log_handler.h" #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 fe06384414..f82c17ccc5 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 diff --git a/functional/otlp/func_http_main.cc b/functional/otlp/func_http_main.cc index 08b7807998..4f6c144a43 100644 --- a/functional/otlp/func_http_main.cc +++ b/functional/otlp/func_http_main.cc @@ -1,16 +1,29 @@ // 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_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; 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 c3b1fb7dd4..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 @@ -12,7 +11,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.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 959ff32800..6ddba6aa7c 100644 --- a/sdk/src/metrics/meter_provider.cc +++ b/sdk/src/metrics/meter_provider.cc @@ -2,9 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include #include -#include #include #include "opentelemetry/common/key_value_iterable.h" 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 f23ce5f628..fd02548c7b 100644 --- a/sdk/src/trace/tracer.cc +++ b/sdk/src/trace/tracer.cc @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -12,7 +11,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..9440e3d469 100644 --- a/sdk/src/trace/tracer_provider.cc +++ b/sdk/src/trace/tracer_provider.cc @@ -3,9 +3,7 @@ #include #include -#include #include -#include #include #include