From d15da3b2568beb50f34098afbab8892232ec8bde Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 27 Nov 2024 11:57:47 +0100 Subject: [PATCH] [Code health] Include what you use cleanup, part 5 (#3140) --- .github/workflows/iwyu.yml | 15 +++- .iwyu.imp | 5 ++ api/include/opentelemetry/nostd/variant.h | 13 ++++ .../trace/propagation/detail/string_test.cc | 6 +- .../exporters/memory/in_memory_metric_data.h | 10 +-- .../in_memory_metric_exporter_factory.h | 10 +-- exporters/memory/src/in_memory_metric_data.cc | 13 ++++ .../src/in_memory_metric_exporter_factory.cc | 9 ++- .../memory/test/in_memory_metric_data_test.cc | 16 +++- .../test/in_memory_metric_exporter_test.cc | 7 +- .../memory/test/in_memory_span_data_test.cc | 8 +- .../test/in_memory_span_exporter_test.cc | 8 +- exporters/ostream/test/ostream_log_test.cc | 32 ++++++-- exporters/ostream/test/ostream_metric_test.cc | 19 +++-- exporters/ostream/test/ostream_span_test.cc | 36 ++++++--- exporters/otlp/src/otlp_file_client.cc | 73 ++++++++++--------- exporters/otlp/src/otlp_log_recordable.cc | 7 +- exporters/otlp/test/otlp_file_client_test.cc | 56 +++++++++----- .../test/otlp_file_exporter_factory_test.cc | 3 + .../otlp/test/otlp_file_exporter_test.cc | 57 +++++++++------ ...p_file_log_record_exporter_factory_test.cc | 3 + .../otlp_file_log_record_exporter_test.cc | 51 ++++++++----- .../otlp_file_metric_exporter_factory_test.cc | 3 + .../test/otlp_file_metric_exporter_test.cc | 42 ++++++----- .../test/otlp_http_exporter_factory_test.cc | 4 + ...p_http_log_record_exporter_factory_test.cc | 4 + .../otlp_http_metric_exporter_factory_test.cc | 4 + .../test/otlp_http_metric_exporter_test.cc | 51 ++++++++----- .../otlp/test/otlp_log_recordable_test.cc | 24 +++++- .../test/otlp_metrics_serialization_test.cc | 24 +++++- exporters/otlp/test/otlp_recordable_test.cc | 30 +++++++- .../zipkin/test/zipkin_recordable_test.cc | 33 ++++++--- ext/test/http/url_parser_test.cc | 2 + .../w3c_tracecontext_http_test_server/main.cc | 9 +++ sdk/src/metrics/state/metric_collector.cc | 2 +- sdk/test/logs/log_record_test.cc | 2 +- sdk/test/metrics/histogram_test.cc | 4 - sdk/test/metrics/meter_test.cc | 2 +- sdk/test/metrics/multi_metric_storage_test.cc | 1 + .../sync_metric_storage_counter_test.cc | 2 +- .../metrics/sync_metric_storage_gauge_test.cc | 22 ++++-- sdk/test/metrics/view_registry_test.cc | 4 - sdk/test/trace/sampler_benchmark.cc | 1 + 43 files changed, 502 insertions(+), 225 deletions(-) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index c675193cdb..573af3a803 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -62,7 +62,16 @@ jobs: - name: count warnings run: | + set +e cd build - COUNT=`grep -c "Warning:" iwyu.log` - echo "include-what-you-use reported ${COUNT} warning(s)" - + readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log` + echo "include-what-you-use reported ${WARNING_COUNT} warning(s)" + # Acceptable limit, to decrease over time down to 0 + readonly WARNING_LIMIT=10 + # FAIL the build if WARNING_COUNT > WARNING_LIMIT + if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then + exit 1 + # WARN in annotations if WARNING_COUNT > 0 + elif [ $WARNING_COUNT -gt 0 ] ; then + echo "::warning::include-what-you-use reported ${WARNING_COUNT} warning(s)" + fi diff --git a/.iwyu.imp b/.iwyu.imp index 6529a92458..a9d2c03058 100644 --- a/.iwyu.imp +++ b/.iwyu.imp @@ -6,6 +6,10 @@ [ # Work around for C++ STL { "include": ["", "private", "", "public"] }, + { "include": ["", "private", "", "public"] }, + { "include": ["", "private", "", "public"] }, + { "include": ["", "private", "", "public"] }, + { "include": ["", "private", "", "public"] }, # Local opentelemetry-cpp style @@ -14,6 +18,7 @@ { "include": ["", "private", "", "public"] }, { "include": ["", "private", "", "public"] }, { "include": ["", "private", "", "public"] }, + { "include": ["", "private", "", "public"] }, # We prefer to include for simplicity { "include": ["", "private", "", "public"] }, diff --git a/api/include/opentelemetry/nostd/variant.h b/api/include/opentelemetry/nostd/variant.h index 02df092d0f..b03a9b844b 100644 --- a/api/include/opentelemetry/nostd/variant.h +++ b/api/include/opentelemetry/nostd/variant.h @@ -54,6 +54,19 @@ OPENTELEMETRY_END_NAMESPACE # ifdef HAVE_ABSEIL # include "absl/types/variant.h" # else +# include "opentelemetry/nostd/internal/absl/base/options.h" + +namespace absl +{ +namespace OTABSL_OPTION_NAMESPACE_NAME +{ +template +struct variant_size; +template +class variant; +} // namespace OTABSL_OPTION_NAMESPACE_NAME +} // namespace absl + # include "opentelemetry/nostd/internal/absl/types/variant.h" # endif diff --git a/api/test/trace/propagation/detail/string_test.cc b/api/test/trace/propagation/detail/string_test.cc index 67a48a354c..184434b528 100644 --- a/api/test/trace/propagation/detail/string_test.cc +++ b/api/test/trace/propagation/detail/string_test.cc @@ -2,10 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include -#include +#include +#include +#include #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/trace/propagation/detail/string.h" using namespace opentelemetry; diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_data.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_data.h index 8d24c586b2..077f5ec699 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_data.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_data.h @@ -3,6 +3,7 @@ #pragma once +#include #include #include #include @@ -10,15 +11,10 @@ #include "opentelemetry/exporters/memory/in_memory_data.h" #include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace sdk -{ -namespace metrics -{ -struct ResourceMetrics; -} -} // namespace sdk namespace exporter { namespace memory diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h index f6934df727..ae1c2b8579 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h @@ -5,22 +5,16 @@ #include +#include "opentelemetry/exporters/memory/in_memory_metric_data.h" #include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace sdk -{ -namespace metrics -{ -class PushMetricExporter; -} // namespace metrics -} // namespace sdk namespace exporter { namespace memory { -class InMemoryMetricData; /// A factory for InMemoryMetricExporter class InMemoryMetricExporterFactory diff --git a/exporters/memory/src/in_memory_metric_data.cc b/exporters/memory/src/in_memory_metric_data.cc index 90f1c1450f..be950b238f 100644 --- a/exporters/memory/src/in_memory_metric_data.cc +++ b/exporters/memory/src/in_memory_metric_data.cc @@ -1,9 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/exporters/memory/in_memory_data.h" #include "opentelemetry/exporters/memory/in_memory_metric_data.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.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" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/memory/src/in_memory_metric_exporter_factory.cc b/exporters/memory/src/in_memory_metric_exporter_factory.cc index 0deff73dcd..227d846fbb 100644 --- a/exporters/memory/src/in_memory_metric_exporter_factory.cc +++ b/exporters/memory/src/in_memory_metric_exporter_factory.cc @@ -1,11 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h" +#include +#include +#include + #include "opentelemetry/exporters/memory/in_memory_metric_data.h" +#include "opentelemetry/exporters/memory/in_memory_metric_exporter_factory.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/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/memory/test/in_memory_metric_data_test.cc b/exporters/memory/test/in_memory_metric_data_test.cc index 3f2d661759..45d42ea064 100644 --- a/exporters/memory/test/in_memory_metric_data_test.cc +++ b/exporters/memory/test/in_memory_metric_data_test.cc @@ -1,15 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include + #include "opentelemetry/exporters/memory/in_memory_metric_data.h" +#include "opentelemetry/nostd/variant.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/sdk/resource/resource.h" -#include - -#include - using opentelemetry::exporter::memory::CircularBufferInMemoryMetricData; using opentelemetry::exporter::memory::SimpleAggregateInMemoryMetricData; using opentelemetry::sdk::metrics::MetricData; diff --git a/exporters/memory/test/in_memory_metric_exporter_test.cc b/exporters/memory/test/in_memory_metric_exporter_test.cc index adaa322f71..64e939f774 100644 --- a/exporters/memory/test/in_memory_metric_exporter_test.cc +++ b/exporters/memory/test/in_memory_metric_exporter_test.cc @@ -1,15 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + #include "opentelemetry/exporters/memory/in_memory_metric_data.h" #include "opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h" +#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/sdk/resource/resource.h" -#include - using opentelemetry::exporter::memory::CircularBufferInMemoryMetricData; using opentelemetry::exporter::memory::InMemoryMetricExporterFactory; using opentelemetry::sdk::common::ExportResult; diff --git a/exporters/memory/test/in_memory_span_data_test.cc b/exporters/memory/test/in_memory_span_data_test.cc index be013734ef..83a907f324 100644 --- a/exporters/memory/test/in_memory_span_data_test.cc +++ b/exporters/memory/test/in_memory_span_data_test.cc @@ -1,12 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include + #include "opentelemetry/exporters/memory/in_memory_span_data.h" -#include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/trace/span_data.h" -#include - using opentelemetry::exporter::memory::InMemorySpanData; using opentelemetry::sdk::trace::SpanData; diff --git a/exporters/memory/test/in_memory_span_exporter_test.cc b/exporters/memory/test/in_memory_span_exporter_test.cc index 56a0ef7790..175942a409 100644 --- a/exporters/memory/test/in_memory_span_exporter_test.cc +++ b/exporters/memory/test/in_memory_span_exporter_test.cc @@ -1,12 +1,16 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include + #include "opentelemetry/exporters/memory/in_memory_span_exporter.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/span_data.h" -#include - using opentelemetry::exporter::memory::InMemorySpanExporter; using opentelemetry::sdk::trace::Recordable; using opentelemetry::sdk::trace::SpanData; diff --git a/exporters/ostream/test/ostream_log_test.cc b/exporters/ostream/test/ostream_log_test.cc index b7708f3153..552b7d1983 100644 --- a/exporters/ostream/test/ostream_log_test.cc +++ b/exporters/ostream/test/ostream_log_test.cc @@ -1,20 +1,42 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/ostream/log_record_exporter.h" #include "opentelemetry/exporters/ostream/log_record_exporter_factory.h" +#include "opentelemetry/logs/event_id.h" +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/logs/logger.h" +#include "opentelemetry/logs/logger_provider.h" #include "opentelemetry/logs/provider.h" +#include "opentelemetry/logs/severity.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/logs/exporter.h" #include "opentelemetry/sdk/logs/logger_provider.h" +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/logs/read_write_log_record.h" +#include "opentelemetry/sdk/logs/readable_log_record.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/logs/simple_log_record_processor.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/version/version.h" - -#include -#include - -#include +#include "opentelemetry/version.h" namespace sdklogs = opentelemetry::sdk::logs; namespace logs_api = opentelemetry::logs; diff --git a/exporters/ostream/test/ostream_metric_test.cc b/exporters/ostream/test/ostream_metric_test.cc index bd221fa1b7..ebd4f451f0 100644 --- a/exporters/ostream/test/ostream_metric_test.cc +++ b/exporters/ostream/test/ostream_metric_test.cc @@ -2,21 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include +#include +#include +#include +#include +#include +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/ostream/metric_exporter.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.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/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/version/version.h" -#include -#include -#include - namespace metric_sdk = opentelemetry::sdk::metrics; namespace nostd = opentelemetry::nostd; namespace exportermetrics = opentelemetry::exporter::metrics; diff --git a/exporters/ostream/test/ostream_span_test.cc b/exporters/ostream/test/ostream_span_test.cc index cadc1b9d38..5cf4bcb510 100644 --- a/exporters/ostream/test/ostream_span_test.cc +++ b/exporters/ostream/test/ostream_span_test.cc @@ -1,22 +1,36 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/exporters/ostream/span_exporter.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/resource/resource.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.h" -#include "opentelemetry/sdk/trace/span_data.h" -#include "opentelemetry/sdk/trace/tracer_provider.h" -#include "opentelemetry/trace/provider.h" - -#include "opentelemetry/sdk/trace/exporter.h" - -#include "opentelemetry/exporters/ostream/span_exporter.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 "ostream_capture.h" -#include -#include - using namespace opentelemetry::exporter::ostream::test; namespace trace = opentelemetry::trace; diff --git a/exporters/otlp/src/otlp_file_client.cc b/exporters/otlp/src/otlp_file_client.cc index bdd6eac27d..ddf2ff1f11 100644 --- a/exporters/otlp/src/otlp_file_client.cc +++ b/exporters/otlp/src/otlp_file_client.cc @@ -1,40 +1,10 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_file_client.h" - -#if defined(HAVE_GSL) -# include -#else -# include -#endif - -// clang-format off -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep -// clang-format on - -#include "google/protobuf/message.h" -#include "nlohmann/json.hpp" - -// clang-format off -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep -// clang-format on - -#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/version.h" - -#ifdef _MSC_VER -# include -# define strcasecmp _stricmp -#else -# include -#endif - #include +#include #include +#include #include #include #include @@ -43,12 +13,24 @@ #include #include #include +#include +#include #include #include #include #include -#if OPENTELEMETRY_HAVE_EXCEPTIONS -# include + +#if defined(HAVE_GSL) +# include +#else +# include +#endif + +#ifdef _MSC_VER +# include +# define strcasecmp _stricmp +#else +# include #endif #if !defined(__CYGWIN__) && defined(_WIN32) @@ -120,6 +102,29 @@ # define OTLP_FILE_OPEN(f, path, mode) f = fopen(path, mode) #endif +#include "opentelemetry/exporters/otlp/otlp_file_client.h" +#include "opentelemetry/exporters/otlp/otlp_file_client_options.h" +#include "opentelemetry/nostd/shared_ptr.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" // IWYU pragma: keep +#include "google/protobuf/descriptor.h" +#include "google/protobuf/message.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on + +// Must be included after opentelemetry/version.h, +// which exports opentelemetry/common/macros.h +#if OPENTELEMETRY_HAVE_EXCEPTIONS +# include +#endif + OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/otlp/src/otlp_log_recordable.cc b/exporters/otlp/src/otlp_log_recordable.cc index 03c89626f2..e45e2b9c11 100644 --- a/exporters/otlp/src/otlp_log_recordable.cc +++ b/exporters/otlp/src/otlp_log_recordable.cc @@ -10,7 +10,6 @@ #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" #include "opentelemetry/sdk/resource/resource.h" @@ -19,6 +18,12 @@ #include "opentelemetry/trace/trace_id.h" #include "opentelemetry/version.h" +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "opentelemetry/proto/logs/v1/logs.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/otlp/test/otlp_file_client_test.cc b/exporters/otlp/test/otlp_file_client_test.cc index f38a682de0..cd4ffb5bc9 100644 --- a/exporters/otlp/test/otlp_file_client_test.cc +++ b/exporters/otlp/test/otlp_file_client_test.cc @@ -1,34 +1,50 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/common/key_value_iterable_view.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_file_client.h" -#include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" +#include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" #include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/resource/resource.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.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/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 #include "opentelemetry/proto/collector/trace/v1/trace_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "nlohmann/json.hpp" - -#include -#include -#include -#include -#include -#include -#include +#include "opentelemetry/proto/trace/v1/trace.pb.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on using namespace testing; diff --git a/exporters/otlp/test/otlp_file_exporter_factory_test.cc b/exporters/otlp/test/otlp_file_exporter_factory_test.cc index 2d671c6e8f..fbb42c8e0c 100644 --- a/exporters/otlp/test/otlp_file_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_file_exporter_factory_test.cc @@ -2,9 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include #include "opentelemetry/exporters/otlp/otlp_file_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/version.h" /* Make sure OtlpFileExporterFactory does not require, diff --git a/exporters/otlp/test/otlp_file_exporter_test.cc b/exporters/otlp/test/otlp_file_exporter_test.cc index 81e1baab44..575339c621 100644 --- a/exporters/otlp/test/otlp_file_exporter_test.cc +++ b/exporters/otlp/test/otlp_file_exporter_test.cc @@ -1,32 +1,47 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/otlp/otlp_file_exporter_factory.h" -#include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "opentelemetry/exporters/otlp/otlp_file_client_options.h" #include "opentelemetry/exporters/otlp/otlp_file_exporter.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - -#include "google/protobuf/message_lite.h" -#include "opentelemetry/proto/collector/trace/v1/trace_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - +#include "opentelemetry/exporters/otlp/otlp_file_exporter_factory.h" +#include "opentelemetry/exporters/otlp/otlp_file_exporter_options.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/batch_span_processor.h" #include "opentelemetry/sdk/trace/batch_span_processor_options.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/tracer_provider.h" - -#include "opentelemetry/trace/provider.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "nlohmann/json.hpp" - -#include -#include -#include +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/span_startoptions.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/version.h" + +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "google/protobuf/message_lite.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on using namespace testing; diff --git a/exporters/otlp/test/otlp_file_log_record_exporter_factory_test.cc b/exporters/otlp/test/otlp_file_log_record_exporter_factory_test.cc index ec4ced5f33..48b8570fc6 100644 --- a/exporters/otlp/test/otlp_file_log_record_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_file_log_record_exporter_factory_test.cc @@ -2,9 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter_options.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/version.h" /* Make sure OtlpFileExporterFactory does not require, diff --git a/exporters/otlp/test/otlp_file_log_record_exporter_test.cc b/exporters/otlp/test/otlp_file_log_record_exporter_test.cc index 5bc1e4a473..4bfd649069 100644 --- a/exporters/otlp/test/otlp_file_log_record_exporter_test.cc +++ b/exporters/otlp/test/otlp_file_log_record_exporter_test.cc @@ -1,33 +1,44 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include "opentelemetry/common/key_value_iterable_view.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_factory.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - -#include "opentelemetry/proto/collector/logs/v1/logs_service.pb.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/common/key_value_iterable_view.h" - -#include "opentelemetry/logs/provider.h" +#include "opentelemetry/exporters/otlp/otlp_file_log_record_exporter_options.h" +#include "opentelemetry/logs/logger.h" +#include "opentelemetry/logs/severity.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/logs/batch_log_record_processor.h" #include "opentelemetry/sdk/logs/exporter.h" #include "opentelemetry/sdk/logs/logger_provider.h" -#include "opentelemetry/sdk/resource/resource.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "nlohmann/json.hpp" - -#include -#include +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_flags.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" + +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on using namespace testing; diff --git a/exporters/otlp/test/otlp_file_metric_exporter_factory_test.cc b/exporters/otlp/test/otlp_file_metric_exporter_factory_test.cc index d14dc3056a..415f425633 100644 --- a/exporters/otlp/test/otlp_file_metric_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_file_metric_exporter_factory_test.cc @@ -2,9 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_options.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/version.h" /* Make sure OtlpFileExporterFactory does not require, diff --git a/exporters/otlp/test/otlp_file_metric_exporter_test.cc b/exporters/otlp/test/otlp_file_metric_exporter_test.cc index 50f60e15b7..f79e2280b6 100644 --- a/exporters/otlp/test/otlp_file_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_file_metric_exporter_test.cc @@ -1,37 +1,39 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include "opentelemetry/common/timestamp.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_factory.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - -#include "google/protobuf/message_lite.h" -#include "opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h" - +#include "opentelemetry/exporters/otlp/otlp_file_metric_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/exporters/otlp/otlp_preferred_temporality.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.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/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "nlohmann/json.hpp" - -#include -#include +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +#include "google/protobuf/message_lite.h" +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on using namespace testing; diff --git a/exporters/otlp/test/otlp_http_exporter_factory_test.cc b/exporters/otlp/test/otlp_http_exporter_factory_test.cc index fd578a65c1..77bf230f70 100644 --- a/exporters/otlp/test/otlp_http_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_http_exporter_factory_test.cc @@ -2,9 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include +#include #include "opentelemetry/exporters/otlp/otlp_http_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/version.h" /* Make sure OtlpHttpExporterFactory does not require, diff --git a/exporters/otlp/test/otlp_http_log_record_exporter_factory_test.cc b/exporters/otlp/test/otlp_http_log_record_exporter_factory_test.cc index 1f3275e1c3..93f2fede12 100644 --- a/exporters/otlp/test/otlp_http_log_record_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_http_log_record_exporter_factory_test.cc @@ -2,9 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include +#include #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/version.h" /* Make sure OtlpHttpExporterFactory does not require, diff --git a/exporters/otlp/test/otlp_http_metric_exporter_factory_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_factory_test.cc index 3158300548..2f042b8f66 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_factory_test.cc @@ -2,9 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include +#include #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/version.h" /* Make sure OtlpHttpExporterFactory does not require, diff --git a/exporters/otlp/test/otlp_http_metric_exporter_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_test.cc index 174597248b..0b44d98379 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_test.cc @@ -1,37 +1,52 @@ // 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 + +#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/exporters/otlp/otlp_http_metric_exporter.h" - -#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" - -#include "opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h" - +#include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" -#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" - -#include "opentelemetry/common/key_value_iterable_view.h" -#include "opentelemetry/ext/http/client/http_client_factory.h" -#include "opentelemetry/ext/http/server/http_server.h" +#include "opentelemetry/exporters/otlp/otlp_preferred_temporality.h" +#include "opentelemetry/ext/http/client/http_client.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.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/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/test_common/ext/http/client/http_client_test_factory.h" #include "opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h" +#include "opentelemetry/version.h" +// clang-format off +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep #include -#include -#include "gmock/gmock.h" - -#include "nlohmann/json.hpp" +#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 #if defined(_MSC_VER) # include "opentelemetry/sdk/common/env_variables.h" diff --git a/exporters/otlp/test/otlp_log_recordable_test.cc b/exporters/otlp/test/otlp_log_recordable_test.cc index e5d6701e46..3e13a66bd9 100644 --- a/exporters/otlp/test/otlp_log_recordable_test.cc +++ b/exporters/otlp/test/otlp_log_recordable_test.cc @@ -2,12 +2,32 @@ // SPDX-License-Identifier: Apache-2.0 #include - +#include #include +#include +#include +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" -#include "opentelemetry/sdk/logs/read_write_log_record.h" +#include "opentelemetry/logs/severity.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/logs/readable_log_record.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_id.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/logs/v1/logs.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/otlp/test/otlp_metrics_serialization_test.cc b/exporters/otlp/test/otlp_metrics_serialization_test.cc index 2ad76dfd1d..9f266e5e5f 100644 --- a/exporters/otlp/test/otlp_metrics_serialization_test.cc +++ b/exporters/otlp/test/otlp_metrics_serialization_test.cc @@ -1,10 +1,30 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" +#include "opentelemetry/exporters/otlp/otlp_preferred_temporality.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/common/v1/common.pb.h" #include "opentelemetry/proto/metrics/v1/metrics.pb.h" - -#include +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep +// clang-format on OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/test/otlp_recordable_test.cc b/exporters/otlp/test/otlp_recordable_test.cc index 537f10340d..9e148e60ee 100644 --- a/exporters/otlp/test/otlp_recordable_test.cc +++ b/exporters/otlp/test/otlp_recordable_test.cc @@ -1,9 +1,34 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_recordable.h" #include "opentelemetry/exporters/otlp/otlp_recordable_utils.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.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/trace/trace_id.h" +#include "opentelemetry/trace/trace_state.h" +#include "opentelemetry/version.h" #if defined(__GNUC__) // GCC raises -Wsuggest-override warnings on GTest, @@ -11,11 +36,12 @@ # pragma GCC diagnostic ignored "-Wsuggest-override" #endif -#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/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 diff --git a/exporters/zipkin/test/zipkin_recordable_test.cc b/exporters/zipkin/test/zipkin_recordable_test.cc index 630ca332f0..2d875ff702 100644 --- a/exporters/zipkin/test/zipkin_recordable_test.cc +++ b/exporters/zipkin/test/zipkin_recordable_test.cc @@ -1,16 +1,31 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/recordable.h" -#include "opentelemetry/sdk/trace/simple_processor.h" -#include "opentelemetry/sdk/trace/span_data.h" -#include "opentelemetry/sdk/trace/tracer_provider.h" -#include "opentelemetry/trace/provider.h" - -#include "opentelemetry/sdk/trace/exporter.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable_view.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/utility.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/trace/trace_id.h" #if defined(__GNUC__) // GCC raises -Wsuggest-override warnings on GTest, @@ -18,8 +33,6 @@ # pragma GCC diagnostic ignored "-Wsuggest-override" #endif -#include - namespace trace = opentelemetry::trace; namespace nostd = opentelemetry::nostd; namespace sdktrace = opentelemetry::sdk::trace; diff --git a/ext/test/http/url_parser_test.cc b/ext/test/http/url_parser_test.cc index 680e73670f..89e4a3efe3 100644 --- a/ext/test/http/url_parser_test.cc +++ b/ext/test/http/url_parser_test.cc @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include +#include #include #include diff --git a/ext/test/w3c_tracecontext_http_test_server/main.cc b/ext/test/w3c_tracecontext_http_test_server/main.cc index 5af8c141de..68128da137 100644 --- a/ext/test/w3c_tracecontext_http_test_server/main.cc +++ b/ext/test/w3c_tracecontext_http_test_server/main.cc @@ -1,25 +1,34 @@ // 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/context/context_value.h" #include "opentelemetry/context/propagation/text_map_propagator.h" #include "opentelemetry/context/runtime_context.h" #include "opentelemetry/exporters/ostream/span_exporter.h" #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/server/http_server.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.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.h" #include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/sdk/trace/tracer_provider.h" diff --git a/sdk/src/metrics/state/metric_collector.cc b/sdk/src/metrics/state/metric_collector.cc index 35d5e53939..e0c61e66e6 100644 --- a/sdk/src/metrics/state/metric_collector.cc +++ b/sdk/src/metrics/state/metric_collector.cc @@ -8,7 +8,6 @@ #include #include -#include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/export/metric_producer.h" @@ -17,6 +16,7 @@ #include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/state/metric_collector.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/test/logs/log_record_test.cc b/sdk/test/logs/log_record_test.cc index 99ba9f296d..74af102e10 100644 --- a/sdk/test/logs/log_record_test.cc +++ b/sdk/test/logs/log_record_test.cc @@ -3,8 +3,8 @@ #include #include -#include #include +#include #include #include diff --git a/sdk/test/metrics/histogram_test.cc b/sdk/test/metrics/histogram_test.cc index 8e0f3c1c1c..0b13664a32 100644 --- a/sdk/test/metrics/histogram_test.cc +++ b/sdk/test/metrics/histogram_test.cc @@ -27,10 +27,6 @@ #include "opentelemetry/sdk/metrics/view/meter_selector.h" #include "opentelemetry/sdk/metrics/view/view.h" -#if OPENTELEMETRY_HAVE_WORKING_REGEX -# include -#endif - using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/meter_test.cc b/sdk/test/metrics/meter_test.cc index 196be7b105..e8dc605e65 100644 --- a/sdk/test/metrics/meter_test.cc +++ b/sdk/test/metrics/meter_test.cc @@ -17,7 +17,7 @@ #include "opentelemetry/metrics/meter.h" #include "opentelemetry/metrics/meter_provider.h" #include "opentelemetry/metrics/observer_result.h" -#include "opentelemetry/metrics/sync_instruments.h" +#include "opentelemetry/metrics/sync_instruments.h" // IWYU pragma: keep #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/exporter_utils.h" diff --git a/sdk/test/metrics/multi_metric_storage_test.cc b/sdk/test/metrics/multi_metric_storage_test.cc index e2449db9d5..3eaf91ee33 100644 --- a/sdk/test/metrics/multi_metric_storage_test.cc +++ b/sdk/test/metrics/multi_metric_storage_test.cc @@ -8,6 +8,7 @@ #include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/context/context.h" #include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/utility.h" #include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" #include "opentelemetry/sdk/metrics/state/multi_metric_storage.h" diff --git a/sdk/test/metrics/sync_metric_storage_counter_test.cc b/sdk/test/metrics/sync_metric_storage_counter_test.cc index c67b9d499a..ee6c2ed57b 100644 --- a/sdk/test/metrics/sync_metric_storage_counter_test.cc +++ b/sdk/test/metrics/sync_metric_storage_counter_test.cc @@ -25,7 +25,7 @@ #include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" -#if ENABLE_METRICS_EXEMPLAR_PREVIEW +#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW # include "opentelemetry/sdk/metrics/exemplar/filter_type.h" # include "opentelemetry/sdk/metrics/exemplar/reservoir.h" #endif diff --git a/sdk/test/metrics/sync_metric_storage_gauge_test.cc b/sdk/test/metrics/sync_metric_storage_gauge_test.cc index f826755af3..db20637e82 100644 --- a/sdk/test/metrics/sync_metric_storage_gauge_test.cc +++ b/sdk/test/metrics/sync_metric_storage_gauge_test.cc @@ -1,17 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "common.h" +#include -#include "opentelemetry/common/key_value_iterable_view.h" -#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/sdk/metrics/instruments.h" -#include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" -#include "opentelemetry/sdk/metrics/view/attributes_processor.h" -#include -#include -#include +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 +# include +# include +# include "common.h" + +# include "opentelemetry/common/key_value_iterable_view.h" +# include "opentelemetry/nostd/shared_ptr.h" +# include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" +# include "opentelemetry/sdk/metrics/view/attributes_processor.h" +#endif using namespace opentelemetry::sdk::metrics; using namespace opentelemetry::common; diff --git a/sdk/test/metrics/view_registry_test.cc b/sdk/test/metrics/view_registry_test.cc index 0135227e16..fd86168d77 100644 --- a/sdk/test/metrics/view_registry_test.cc +++ b/sdk/test/metrics/view_registry_test.cc @@ -15,10 +15,6 @@ #include "opentelemetry/sdk/metrics/view/view.h" #include "opentelemetry/sdk/metrics/view/view_registry.h" -#if OPENTELEMETRY_HAVE_WORKING_REGEX -# include -#endif - using namespace opentelemetry::sdk::metrics; using namespace opentelemetry::sdk::instrumentationscope; diff --git a/sdk/test/trace/sampler_benchmark.cc b/sdk/test/trace/sampler_benchmark.cc index 529143b53e..ef9f37af95 100644 --- a/sdk/test/trace/sampler_benchmark.cc +++ b/sdk/test/trace/sampler_benchmark.cc @@ -10,6 +10,7 @@ #include #include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/context/context_value.h" // IWYU pragma: keep #include "opentelemetry/exporters/memory/in_memory_span_exporter.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/exporter.h"