From c6d394547b012077998b6bd74665145488e85ffe Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 11 Sep 2024 21:05:32 +0200 Subject: [PATCH] [Code Health] include-what-you-use cleanup, part 4 (#3040) --- .iwyu.imp | 8 +++- .../exporters/memory/in_memory_span_data.h | 8 ++-- .../memory/in_memory_span_exporter.h | 11 ++++- exporters/zipkin/src/zipkin_exporter.cc | 1 + .../ext/http/common/url_parser.h | 5 +- ext/test/http/curl_http_test.cc | 21 +++++---- ext/test/http/url_parser_test.cc | 7 ++- ext/test/w3c_tracecontext_test/main.cc | 25 ++++++++-- .../sdk/common/attribute_utils.h | 8 +++- .../sdk/common/attributemap_hash.h | 7 +++ .../sdk/common/circular_buffer.h | 3 ++ .../sdk/common/circular_buffer_range.h | 3 +- .../sdk/metrics/observer_result.h | 2 + .../sdk/metrics/state/attributes_hashmap.h | 13 +++-- .../sdk/metrics/state/multi_metric_storage.h | 16 ++----- .../sdk/metrics/sync_instruments.h | 1 - .../sdk/metrics/view/attributes_processor.h | 4 +- .../sdk/metrics/view/view_registry.h | 6 ++- .../sdk/trace/simple_processor.h | 3 ++ .../opentelemetry/sdk/trace/span_data.h | 8 +++- sdk/include/opentelemetry/sdk/trace/tracer.h | 2 - .../opentelemetry/sdk/trace/tracer_provider.h | 1 - .../metrics/aggregation/sum_aggregation.cc | 1 - .../periodic_exporting_metric_reader.cc | 2 - sdk/src/metrics/meter_context.cc | 1 - sdk/src/trace/samplers/parent_factory.cc | 3 +- sdk/test/common/attribute_utils_test.cc | 10 ++-- .../common/attributemap_hash_benchmark.cc | 2 + sdk/test/common/circular_buffer_benchmark.cc | 10 +++- sdk/test/common/circular_buffer_range_test.cc | 6 +-- sdk/test/common/circular_buffer_test.cc | 16 +++++-- sdk/test/common/env_var_test.cc | 7 ++- .../fast_random_number_generator_test.cc | 8 ++-- sdk/test/common/global_log_handle_test.cc | 7 +-- sdk/test/common/random_benchmark.cc | 6 +-- sdk/test/common/random_fork_test.cc | 4 +- sdk/test/common/random_test.cc | 8 ++-- .../instrumentationscope_test.cc | 15 ++++-- .../logs/batch_log_record_processor_test.cc | 24 ++++++++-- sdk/test/logs/log_record_test.cc | 22 +++++++-- sdk/test/logs/logger_provider_sdk_test.cc | 24 ++++++++-- sdk/test/logs/logger_sdk_test.cc | 24 ++++++++-- .../logs/simple_log_record_processor_test.cc | 24 +++++++--- sdk/test/metrics/aggregation_test.cc | 10 ++-- sdk/test/metrics/async_instruments_test.cc | 13 ++++- sdk/test/metrics/async_metric_storage_test.cc | 39 ++++++++------- .../metrics/attributes_hashmap_benchmark.cc | 17 ++++--- sdk/test/metrics/attributes_hashmap_test.cc | 20 ++++++-- .../metrics/attributes_processor_benchmark.cc | 5 ++ sdk/test/metrics/attributes_processor_test.cc | 11 ++++- ...exponential_histogram_indexer_benchmark.cc | 5 +- ...ase2_exponential_histogram_indexer_test.cc | 6 ++- sdk/test/metrics/cardinality_limit_test.cc | 31 ++++++++++-- .../metrics/circular_buffer_counter_test.cc | 5 +- sdk/test/metrics/common.cc | 4 +- sdk/test/metrics/common.h | 9 ++-- .../histogram_aggregation_benchmark.cc | 21 +++++++-- .../metrics/histogram_aggregation_test.cc | 21 +++++++-- sdk/test/metrics/histogram_test.cc | 22 +++++++-- .../instrument_metadata_validator_test.cc | 6 ++- sdk/test/metrics/measurements_benchmark.cc | 29 +++++++++--- sdk/test/metrics/meter_provider_sdk_test.cc | 10 +++- sdk/test/metrics/meter_test.cc | 23 +++++++-- sdk/test/metrics/metric_reader_test.cc | 10 +++- sdk/test/metrics/multi_metric_storage_test.cc | 15 +++--- sdk/test/metrics/observable_registry_test.cc | 5 +- sdk/test/metrics/observer_result_test.cc | 12 ++++- .../periodic_exporting_metric_reader_test.cc | 19 ++++++-- sdk/test/metrics/sum_aggregation_benchmark.cc | 24 +++++++--- sdk/test/metrics/sum_aggregation_test.cc | 26 ++++++++-- sdk/test/metrics/sync_instruments_test.cc | 19 +++++--- .../sync_metric_storage_counter_test.cc | 28 +++++++---- .../sync_metric_storage_histogram_test.cc | 29 ++++++++---- ...ync_metric_storage_up_down_counter_test.cc | 29 ++++++++---- sdk/test/metrics/view_registry_test.cc | 15 ++++-- sdk/test/resource/resource_test.cc | 18 ++++--- sdk/test/trace/always_off_sampler_test.cc | 12 +++++ sdk/test/trace/always_on_sampler_test.cc | 18 +++++-- sdk/test/trace/batch_span_processor_test.cc | 28 ++++++----- sdk/test/trace/parent_sampler_test.cc | 18 ++++++- sdk/test/trace/sampler_benchmark.cc | 24 ++++++++-- sdk/test/trace/simple_processor_test.cc | 16 +++++-- sdk/test/trace/span_data_test.cc | 33 +++++++++---- sdk/test/trace/trace_id_ratio_sampler_test.cc | 20 ++++++-- sdk/test/trace/tracer_provider_test.cc | 23 ++++++--- sdk/test/trace/tracer_test.cc | 47 +++++++++++++++++-- .../http/client/http_client_test_factory.h | 4 ++ .../http/client/nosend/http_client_nosend.h | 20 ++++---- .../http/client/nosend/http_client_nosend.cc | 11 +++++ 89 files changed, 912 insertions(+), 305 deletions(-) diff --git a/.iwyu.imp b/.iwyu.imp index 7ebbeae511..6529a92458 100644 --- a/.iwyu.imp +++ b/.iwyu.imp @@ -7,10 +7,16 @@ # Work around for C++ STL { "include": ["", "private", "", "public"] }, - # Local opentelemetry-cpp + # Local opentelemetry-cpp style + # We prefer to include for simplicity { "include": ["", "private", "", "public"] }, { "include": ["", "private", "", "public"] }, + { "include": ["", "private", "", "public"] }, { "include": ["", "private", "", "public"] }, + + # We prefer to include for simplicity + { "include": ["", "private", "", "public"] }, + { "include": ["", "private", "", "public"] }, ] diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_data.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_data.h index 874b475690..6eaae0663c 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_data.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_data.h @@ -3,11 +3,13 @@ #pragma once +#include +#include +#include + #include "opentelemetry/exporters/memory/in_memory_data.h" -#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/span_data.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h index 0c2a14a673..6be83113ce 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h @@ -3,13 +3,20 @@ #pragma once +#include #include -#include +#include +#include +#include +#include #include "opentelemetry/exporters/memory/in_memory_span_data.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/exporter.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/span_data.h" -#include "opentelemetry/sdk_config.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/zipkin/src/zipkin_exporter.cc b/exporters/zipkin/src/zipkin_exporter.cc index 4c5723c674..5d5dd728a6 100644 --- a/exporters/zipkin/src/zipkin_exporter.cc +++ b/exporters/zipkin/src/zipkin_exporter.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include "nlohmann/json.hpp" diff --git a/ext/include/opentelemetry/ext/http/common/url_parser.h b/ext/include/opentelemetry/ext/http/common/url_parser.h index 5e18d85bb6..386d4fcd2f 100644 --- a/ext/include/opentelemetry/ext/http/common/url_parser.h +++ b/ext/include/opentelemetry/ext/http/common/url_parser.h @@ -3,11 +3,12 @@ #pragma once +#include #include #include -#include -#include "opentelemetry/nostd/string_view.h" + #include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace ext { diff --git a/ext/test/http/curl_http_test.cc b/ext/test/http/curl_http_test.cc index d5351d2314..137c9b7f9b 100644 --- a/ext/test/http/curl_http_test.cc +++ b/ext/test/http/curl_http_test.cc @@ -1,23 +1,28 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/ext//http/client/curl/http_client_curl.h" -#include "opentelemetry/ext/http/client/http_client_factory.h" -#include "opentelemetry/ext/http/server/http_server.h" - -#include +#include +#include #include #include #include #include +#include #include -#include +#include +#include #include #include -#define HTTP_PORT 19000 +#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/client/http_client_factory.h" +#include "opentelemetry/ext/http/server/http_server.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/string_view.h" -#include +#define HTTP_PORT 19000 namespace curl = opentelemetry::ext::http::client::curl; namespace http_client = opentelemetry::ext::http::client; diff --git a/ext/test/http/url_parser_test.cc b/ext/test/http/url_parser_test.cc index 7b28d763e6..79a5e60a60 100644 --- a/ext/test/http/url_parser_test.cc +++ b/ext/test/http/url_parser_test.cc @@ -1,9 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/ext/http/common/url_parser.h" - #include +#include +#include +#include + +#include "opentelemetry/ext/http/common/url_parser.h" namespace http_common = opentelemetry::ext::http::common; diff --git a/ext/test/w3c_tracecontext_test/main.cc b/ext/test/w3c_tracecontext_test/main.cc index 4e9fb36796..fed07a2398 100644 --- a/ext/test/w3c_tracecontext_test/main.cc +++ b/ext/test/w3c_tracecontext_test/main.cc @@ -1,19 +1,38 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#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" #include "opentelemetry/trace/propagation/http_trace_context.h" #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/scope.h" - -#include -#include "nlohmann/json.hpp" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/trace/tracer_provider.h" namespace trace_api = opentelemetry::trace; namespace http_client = opentelemetry::ext::http::client; diff --git a/sdk/include/opentelemetry/sdk/common/attribute_utils.h b/sdk/include/opentelemetry/sdk/common/attribute_utils.h index e21649b695..86b507a66b 100644 --- a/sdk/include/opentelemetry/sdk/common/attribute_utils.h +++ b/sdk/include/opentelemetry/sdk/common/attribute_utils.h @@ -3,13 +3,19 @@ #pragma once +#include +#include #include #include #include +#include #include #include "opentelemetry/common/attribute_value.h" -#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/common/attributemap_hash.h b/sdk/include/opentelemetry/sdk/common/attributemap_hash.h index e09b03d08b..39df29b278 100644 --- a/sdk/include/opentelemetry/sdk/common/attributemap_hash.h +++ b/sdk/include/opentelemetry/sdk/common/attributemap_hash.h @@ -3,8 +3,15 @@ #pragma once +#include #include +#include +#include +#include +#include +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/nostd/variant.h" diff --git a/sdk/include/opentelemetry/sdk/common/circular_buffer.h b/sdk/include/opentelemetry/sdk/common/circular_buffer.h index 6541612158..a35498ecea 100644 --- a/sdk/include/opentelemetry/sdk/common/circular_buffer.h +++ b/sdk/include/opentelemetry/sdk/common/circular_buffer.h @@ -5,9 +5,12 @@ #include #include +#include #include +#include #include +#include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/common/atomic_unique_ptr.h" #include "opentelemetry/sdk/common/circular_buffer_range.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/common/circular_buffer_range.h b/sdk/include/opentelemetry/sdk/common/circular_buffer_range.h index e9b89f9d02..5e16c3d410 100644 --- a/sdk/include/opentelemetry/sdk/common/circular_buffer_range.h +++ b/sdk/include/opentelemetry/sdk/common/circular_buffer_range.h @@ -3,8 +3,9 @@ #pragma once +#include #include -#include +#include #include "opentelemetry/nostd/span.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/observer_result.h b/sdk/include/opentelemetry/sdk/metrics/observer_result.h index 4ed3cd168d..cc60cf5f64 100644 --- a/sdk/include/opentelemetry/sdk/metrics/observer_result.h +++ b/sdk/include/opentelemetry/sdk/metrics/observer_result.h @@ -5,8 +5,10 @@ #include +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/metrics/observer_result.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h b/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h index a509080318..ddf2a8b206 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h @@ -3,18 +3,21 @@ #pragma once +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/common/attributemap_hash.h" #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" -#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" #include "opentelemetry/version.h" -#include -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h index 6202b0c7fb..2a77b2f856 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h @@ -3,26 +3,20 @@ #pragma once +#include #include #include #include +#include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/common/timestamp.h" -#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace common -{ -class KeyValueIterable; -} // namespace common - -namespace context -{ -class Context; -} // namespace context - namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h b/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h index 1d5f8dbc55..039a37e748 100644 --- a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h @@ -12,7 +12,6 @@ #include "opentelemetry/metrics/sync_instruments.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" -#include "opentelemetry/sdk_config.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h index a71abb7a99..5d53959e1b 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h @@ -5,9 +5,11 @@ #include #include +#include + +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/view/view_registry.h b/sdk/include/opentelemetry/sdk/metrics/view/view_registry.h index 40343c28de..fd1e4bee0c 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/view_registry.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/view_registry.h @@ -3,14 +3,18 @@ #pragma once +#include #include -#include +#include +#include #include #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/view/instrument_selector.h" #include "opentelemetry/sdk/metrics/view/meter_selector.h" +#include "opentelemetry/sdk/metrics/view/predicate.h" #include "opentelemetry/sdk/metrics/view/view.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/trace/simple_processor.h b/sdk/include/opentelemetry/sdk/trace/simple_processor.h index dee8e80bb8..ce6d378b79 100644 --- a/sdk/include/opentelemetry/sdk/trace/simple_processor.h +++ b/sdk/include/opentelemetry/sdk/trace/simple_processor.h @@ -7,12 +7,15 @@ #include #include #include +#include #include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/trace/span_context.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/trace/span_data.h b/sdk/include/opentelemetry/sdk/trace/span_data.h index 8e301c1a01..2bd8b2112b 100644 --- a/sdk/include/opentelemetry/sdk/trace/span_data.h +++ b/sdk/include/opentelemetry/sdk/trace/span_data.h @@ -11,14 +11,18 @@ #include #include "opentelemetry/common/attribute_value.h" -#include "opentelemetry/common/macros.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/key_value_iterable_view.h" #include "opentelemetry/common/timestamp.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/recordable.h" -#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_flags.h" #include "opentelemetry/trace/trace_id.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/trace/tracer.h b/sdk/include/opentelemetry/sdk/trace/tracer.h index fb8342c1d5..f738203b4f 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer.h @@ -4,12 +4,10 @@ #pragma once #include -#include #include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/id_generator.h" diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_provider.h b/sdk/include/opentelemetry/sdk/trace/tracer_provider.h index 13a65a2d87..44d5840558 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_provider.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_provider.h @@ -4,7 +4,6 @@ #pragma once #include -#include #include #include diff --git a/sdk/src/metrics/aggregation/sum_aggregation.cc b/sdk/src/metrics/aggregation/sum_aggregation.cc index ce0d4c5de5..cd518e5460 100644 --- a/sdk/src/metrics/aggregation/sum_aggregation.cc +++ b/sdk/src/metrics/aggregation/sum_aggregation.cc @@ -4,7 +4,6 @@ #include #include #include -#include #include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/nostd/variant.h" diff --git a/sdk/src/metrics/export/periodic_exporting_metric_reader.cc b/sdk/src/metrics/export/periodic_exporting_metric_reader.cc index 42fd6003ae..682badf3a4 100644 --- a/sdk/src/metrics/export/periodic_exporting_metric_reader.cc +++ b/sdk/src/metrics/export/periodic_exporting_metric_reader.cc @@ -9,11 +9,9 @@ #include #include #include -#include #include #include -#include "opentelemetry/common/macros.h" #include "opentelemetry/common/timestamp.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/export/metric_producer.h" diff --git a/sdk/src/metrics/meter_context.cc b/sdk/src/metrics/meter_context.cc index 42efce76fb..15e689706a 100644 --- a/sdk/src/metrics/meter_context.cc +++ b/sdk/src/metrics/meter_context.cc @@ -7,7 +7,6 @@ #include #include #include -#include #include #include diff --git a/sdk/src/trace/samplers/parent_factory.cc b/sdk/src/trace/samplers/parent_factory.cc index 63a7eff1c4..25a2e94f65 100644 --- a/sdk/src/trace/samplers/parent_factory.cc +++ b/sdk/src/trace/samplers/parent_factory.cc @@ -1,8 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include +#include +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/parent.h" #include "opentelemetry/sdk/trace/samplers/parent_factory.h" #include "opentelemetry/version.h" diff --git a/sdk/test/common/attribute_utils_test.cc b/sdk/test/common/attribute_utils_test.cc index b7ef17244f..9b1f6bd56e 100644 --- a/sdk/test/common/attribute_utils_test.cc +++ b/sdk/test/common/attribute_utils_test.cc @@ -1,13 +1,17 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/common/attribute_utils.h" - #include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/attribute_utils.h" TEST(AttributeMapTest, DefaultConstruction) { - opentelemetry::sdk::common::AttributeMap attribute_map; EXPECT_EQ(attribute_map.GetAttributes().size(), 0); } diff --git a/sdk/test/common/attributemap_hash_benchmark.cc b/sdk/test/common/attributemap_hash_benchmark.cc index 811ecb23dd..e0641fb961 100644 --- a/sdk/test/common/attributemap_hash_benchmark.cc +++ b/sdk/test/common/attributemap_hash_benchmark.cc @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 #include + +#include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/common/attributemap_hash.h" using namespace opentelemetry::sdk::common; diff --git a/sdk/test/common/circular_buffer_benchmark.cc b/sdk/test/common/circular_buffer_benchmark.cc index 1f2b9b42cf..7ffc452135 100644 --- a/sdk/test/common/circular_buffer_benchmark.cc +++ b/sdk/test/common/circular_buffer_benchmark.cc @@ -1,18 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "benchmark/benchmark.h" - +#include #include #include +#include +#include #include #include #include #include #include +#include "benchmark/benchmark.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/atomic_unique_ptr.h" #include "opentelemetry/sdk/common/circular_buffer.h" +#include "opentelemetry/sdk/common/circular_buffer_range.h" #include "test/common/baseline_circular_buffer.h" + using opentelemetry::sdk::common::AtomicUniquePtr; using opentelemetry::sdk::common::CircularBuffer; using opentelemetry::sdk::common::CircularBufferRange; diff --git a/sdk/test/common/circular_buffer_range_test.cc b/sdk/test/common/circular_buffer_range_test.cc index 5852704687..ed2f028978 100644 --- a/sdk/test/common/circular_buffer_range_test.cc +++ b/sdk/test/common/circular_buffer_range_test.cc @@ -1,11 +1,11 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/common/circular_buffer_range.h" +#include -#include +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/circular_buffer_range.h" -#include using opentelemetry::sdk::common::CircularBufferRange; TEST(CircularBufferRangeTest, ForEach) diff --git a/sdk/test/common/circular_buffer_test.cc b/sdk/test/common/circular_buffer_test.cc index a20c3e42aa..8a3292ca60 100644 --- a/sdk/test/common/circular_buffer_test.cc +++ b/sdk/test/common/circular_buffer_test.cc @@ -1,14 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/common/circular_buffer.h" - +#include +#include #include +#include #include +#include +#include +#include +#include #include #include +#include + +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/atomic_unique_ptr.h" +#include "opentelemetry/sdk/common/circular_buffer.h" +#include "opentelemetry/sdk/common/circular_buffer_range.h" -#include using opentelemetry::sdk::common::AtomicUniquePtr; using opentelemetry::sdk::common::CircularBuffer; using opentelemetry::sdk::common::CircularBufferRange; diff --git a/sdk/test/common/env_var_test.cc b/sdk/test/common/env_var_test.cc index 23d3802361..8f64dc1f10 100644 --- a/sdk/test/common/env_var_test.cc +++ b/sdk/test/common/env_var_test.cc @@ -1,9 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/common/env_variables.h" - #include +#include +#include +#include + +#include "opentelemetry/sdk/common/env_variables.h" #if defined(_MSC_VER) using opentelemetry::sdk::common::setenv; diff --git a/sdk/test/common/fast_random_number_generator_test.cc b/sdk/test/common/fast_random_number_generator_test.cc index e9209fdb6b..1f87ea13d7 100644 --- a/sdk/test/common/fast_random_number_generator_test.cc +++ b/sdk/test/common/fast_random_number_generator_test.cc @@ -1,11 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "src/common/random.h" - +#include +#include #include +#include +#include -#include +#include "src/common/fast_random_number_generator.h" using opentelemetry::sdk::common::FastRandomNumberGenerator; diff --git a/sdk/test/common/global_log_handle_test.cc b/sdk/test/common/global_log_handle_test.cc index 28b111cc71..3c3fc3d7f3 100644 --- a/sdk/test/common/global_log_handle_test.cc +++ b/sdk/test/common/global_log_handle_test.cc @@ -1,12 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/common/global_log_handler.h" - #include - #include +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/global_log_handler.h" + class CustomLogHandler : public opentelemetry::sdk::common::internal_log::LogHandler { public: diff --git a/sdk/test/common/random_benchmark.cc b/sdk/test/common/random_benchmark.cc index df2ebf95ec..46dadbe260 100644 --- a/sdk/test/common/random_benchmark.cc +++ b/sdk/test/common/random_benchmark.cc @@ -1,12 +1,10 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "src/common/random.h" - -#include +#include #include -#include +#include "src/common/random.h" namespace { diff --git a/sdk/test/common/random_fork_test.cc b/sdk/test/common/random_fork_test.cc index 2db8b9fcdf..15f7a43cf2 100644 --- a/sdk/test/common/random_fork_test.cc +++ b/sdk/test/common/random_fork_test.cc @@ -7,13 +7,13 @@ // See https://github.com/opentracing-contrib/nginx-opentracing/issues/52 # include "src/common/random.h" +# include # include -# include # include # include -# include # include # include + using opentelemetry::sdk::common::Random; static uint64_t *child_id; diff --git a/sdk/test/common/random_test.cc b/sdk/test/common/random_test.cc index e22e0508fc..85292babe4 100644 --- a/sdk/test/common/random_test.cc +++ b/sdk/test/common/random_test.cc @@ -1,15 +1,17 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "src/common/random.h" - +#include #include #include +#include +#include #include #include #include -#include +#include "src/common/random.h" + using opentelemetry::sdk::common::Random; TEST(RandomTest, GenerateRandom64) diff --git a/sdk/test/instrumentationscope/instrumentationscope_test.cc b/sdk/test/instrumentationscope/instrumentationscope_test.cc index 2f376d5d6b..da00ec8e93 100644 --- a/sdk/test/instrumentationscope/instrumentationscope_test.cc +++ b/sdk/test/instrumentationscope/instrumentationscope_test.cc @@ -1,15 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/nostd/string_view.h" -#include "opentelemetry/sdk/instrumentationlibrary/instrumentation_library.h" -#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" - #include +#include +#include #include #include +#include #include +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/instrumentationlibrary/instrumentation_library.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" + using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; diff --git a/sdk/test/logs/batch_log_record_processor_test.cc b/sdk/test/logs/batch_log_record_processor_test.cc index 3bdd849938..036146f4e6 100644 --- a/sdk/test/logs/batch_log_record_processor_test.cc +++ b/sdk/test/logs/batch_log_record_processor_test.cc @@ -1,15 +1,31 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/batch_log_record_processor.h" -#include "opentelemetry/sdk/logs/exporter.h" -#include "opentelemetry/sdk/logs/recordable.h" - #include +#include +#include #include +#include #include +#include #include #include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/logs/log_record.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/atomic_unique_ptr.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/logs/batch_log_record_processor.h" +#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" using namespace opentelemetry::sdk::logs; using namespace opentelemetry::sdk::common; diff --git a/sdk/test/logs/log_record_test.cc b/sdk/test/logs/log_record_test.cc index bd9e462012..99ba9f296d 100644 --- a/sdk/test/logs/log_record_test.cc +++ b/sdk/test/logs/log_record_test.cc @@ -1,21 +1,33 @@ // 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.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/logs/event_id.h" +#include "opentelemetry/logs/log_record.h" #include "opentelemetry/logs/logger.h" -#include "opentelemetry/logs/provider.h" +#include "opentelemetry/logs/logger_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/unique_ptr.h" +#include "opentelemetry/nostd/utility.h" #include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/logs/read_write_log_record.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_flags.h" #include "opentelemetry/trace/trace_id.h" -#include - using opentelemetry::sdk::logs::ReadWriteLogRecord; namespace trace_api = opentelemetry::trace; namespace logs_api = opentelemetry::logs; diff --git a/sdk/test/logs/logger_provider_sdk_test.cc b/sdk/test/logs/logger_provider_sdk_test.cc index ecb9ea6f9c..a5a3d3a68a 100644 --- a/sdk/test/logs/logger_provider_sdk_test.cc +++ b/sdk/test/logs/logger_provider_sdk_test.cc @@ -1,20 +1,38 @@ // 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/timestamp.h" +#include "opentelemetry/logs/log_record.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/string_view.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/logs/event_logger_provider.h" #include "opentelemetry/sdk/logs/event_logger_provider_factory.h" #include "opentelemetry/sdk/logs/exporter.h" #include "opentelemetry/sdk/logs/logger.h" +#include "opentelemetry/sdk/logs/logger_context.h" #include "opentelemetry/sdk/logs/logger_provider.h" +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/logs/simple_log_record_processor.h" - -#include +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_flags.h" +#include "opentelemetry/trace/trace_id.h" using namespace opentelemetry::sdk::logs; namespace logs_api = opentelemetry::logs; diff --git a/sdk/test/logs/logger_sdk_test.cc b/sdk/test/logs/logger_sdk_test.cc index 9e63672d3c..4af0fb3745 100644 --- a/sdk/test/logs/logger_sdk_test.cc +++ b/sdk/test/logs/logger_sdk_test.cc @@ -1,26 +1,44 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include #include #include #include - +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/logs/event_logger.h" +#include "opentelemetry/logs/event_logger_provider.h" +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/logs/logger.h" #include "opentelemetry/logs/logger_provider.h" +#include "opentelemetry/logs/severity.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/logs/event_logger.h" #include "opentelemetry/sdk/logs/event_logger_provider.h" #include "opentelemetry/sdk/logs/logger.h" #include "opentelemetry/sdk/logs/logger_provider.h" #include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/scope.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_flags.h" +#include "opentelemetry/trace/trace_id.h" #include "opentelemetry/trace/tracer.h" -#include - using namespace opentelemetry::sdk::logs; namespace logs_api = opentelemetry::logs; namespace nostd = opentelemetry::nostd; diff --git a/sdk/test/logs/simple_log_record_processor_test.cc b/sdk/test/logs/simple_log_record_processor_test.cc index 30e5771394..b8a9f03e0c 100644 --- a/sdk/test/logs/simple_log_record_processor_test.cc +++ b/sdk/test/logs/simple_log_record_processor_test.cc @@ -1,16 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/simple_log_record_processor.h" -#include "opentelemetry/nostd/span.h" -#include "opentelemetry/sdk/logs/exporter.h" -#include "opentelemetry/sdk/logs/recordable.h" - #include - +#include +#include #include -#include +#include +#include #include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/logs/log_record.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/exporter_utils.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/sdk/logs/simple_log_record_processor.h" using namespace opentelemetry::sdk::logs; using namespace opentelemetry::sdk::common; diff --git a/sdk/test/metrics/aggregation_test.cc b/sdk/test/metrics/aggregation_test.cc index d52cc9e732..d56f33545a 100644 --- a/sdk/test/metrics/aggregation_test.cc +++ b/sdk/test/metrics/aggregation_test.cc @@ -2,13 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include +#include + +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" #include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/sum_aggregation.h" - -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" using namespace opentelemetry::sdk::metrics; namespace nostd = opentelemetry::nostd; diff --git a/sdk/test/metrics/async_instruments_test.cc b/sdk/test/metrics/async_instruments_test.cc index 01a421e046..cda08a1549 100644 --- a/sdk/test/metrics/async_instruments_test.cc +++ b/sdk/test/metrics/async_instruments_test.cc @@ -1,12 +1,21 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +#include "opentelemetry/metrics/observer_result.h" +#include "opentelemetry/nostd/utility.h" #include "opentelemetry/sdk/metrics/async_instruments.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" +#include "opentelemetry/sdk/metrics/state/metric_storage.h" #include "opentelemetry/sdk/metrics/state/multi_metric_storage.h" #include "opentelemetry/sdk/metrics/state/observable_registry.h" -#include - using namespace opentelemetry; using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/async_metric_storage_test.cc b/sdk/test/metrics/async_metric_storage_test.cc index dcbe105418..912310415a 100644 --- a/sdk/test/metrics/async_metric_storage_test.cc +++ b/sdk/test/metrics/async_metric_storage_test.cc @@ -1,30 +1,37 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "common.h" -#include "opentelemetry/common/key_value_iterable_view.h" -#include "opentelemetry/sdk/metrics/async_instruments.h" +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/variant.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/state/async_metric_storage.h" +#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW # include "opentelemetry/sdk/metrics/exemplar/filter_type.h" # include "opentelemetry/sdk/metrics/exemplar/reservoir.h" #endif -#include "opentelemetry/sdk/metrics/instruments.h" -#include "opentelemetry/sdk/metrics/meter_context.h" -#include "opentelemetry/sdk/metrics/metric_reader.h" -#include "opentelemetry/sdk/metrics/observer_result.h" -#include "opentelemetry/sdk/metrics/push_metric_exporter.h" -#include "opentelemetry/sdk/metrics/state/async_metric_storage.h" -#include "opentelemetry/sdk/metrics/state/metric_collector.h" -#include "opentelemetry/sdk/metrics/state/observable_registry.h" - -#include -#include -#include -#include - using namespace opentelemetry::sdk::metrics; using namespace opentelemetry::sdk::instrumentationscope; using namespace opentelemetry::sdk::resource; diff --git a/sdk/test/metrics/attributes_hashmap_benchmark.cc b/sdk/test/metrics/attributes_hashmap_benchmark.cc index 5dc02ca5be..ed080d911d 100644 --- a/sdk/test/metrics/attributes_hashmap_benchmark.cc +++ b/sdk/test/metrics/attributes_hashmap_benchmark.cc @@ -2,17 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include "opentelemetry/sdk/common/attributemap_hash.h" -#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/drop_aggregation.h" -#include "opentelemetry/sdk/metrics/instruments.h" -#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" - +#include +#include +#include #include +#include #include #include #include +#include "opentelemetry/sdk/common/attributemap_hash.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/aggregation/drop_aggregation.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" + using namespace opentelemetry::sdk::metrics; constexpr size_t MAX_THREADS = 500; namespace diff --git a/sdk/test/metrics/attributes_hashmap_test.cc b/sdk/test/metrics/attributes_hashmap_test.cc index 7d77e6166a..c7f0f01ee5 100644 --- a/sdk/test/metrics/attributes_hashmap_test.cc +++ b/sdk/test/metrics/attributes_hashmap_test.cc @@ -1,12 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" #include -#include "opentelemetry/sdk/metrics/aggregation/drop_aggregation.h" -#include "opentelemetry/sdk/metrics/instruments.h" - +#include +#include #include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/sdk/common/attributemap_hash.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/aggregation/drop_aggregation.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" using namespace opentelemetry::sdk::metrics; namespace nostd = opentelemetry::nostd; diff --git a/sdk/test/metrics/attributes_processor_benchmark.cc b/sdk/test/metrics/attributes_processor_benchmark.cc index 28f1984b40..708549406b 100644 --- a/sdk/test/metrics/attributes_processor_benchmark.cc +++ b/sdk/test/metrics/attributes_processor_benchmark.cc @@ -3,7 +3,12 @@ #include #include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" + using namespace opentelemetry::sdk::metrics; namespace { diff --git a/sdk/test/metrics/attributes_processor_test.cc b/sdk/test/metrics/attributes_processor_test.cc index 62c0879ca9..5299af1358 100644 --- a/sdk/test/metrics/attributes_processor_test.cc +++ b/sdk/test/metrics/attributes_processor_test.cc @@ -1,8 +1,17 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/view/attributes_processor.h" #include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" using namespace opentelemetry::sdk::metrics; using namespace opentelemetry::common; diff --git a/sdk/test/metrics/base2_exponential_histogram_indexer_benchmark.cc b/sdk/test/metrics/base2_exponential_histogram_indexer_benchmark.cc index 9f1d0d864d..40ea14d575 100644 --- a/sdk/test/metrics/base2_exponential_histogram_indexer_benchmark.cc +++ b/sdk/test/metrics/base2_exponential_histogram_indexer_benchmark.cc @@ -1,12 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/aggregation/base2_exponential_histogram_indexer.h" - #include +#include #include #include +#include "opentelemetry/sdk/metrics/aggregation/base2_exponential_histogram_indexer.h" + using namespace opentelemetry::sdk::metrics; namespace { diff --git a/sdk/test/metrics/base2_exponential_histogram_indexer_test.cc b/sdk/test/metrics/base2_exponential_histogram_indexer_test.cc index 85f6fe72e9..716985e7cf 100644 --- a/sdk/test/metrics/base2_exponential_histogram_indexer_test.cc +++ b/sdk/test/metrics/base2_exponential_histogram_indexer_test.cc @@ -1,9 +1,11 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/aggregation/base2_exponential_histogram_indexer.h" - #include +#include +#include + +#include "opentelemetry/sdk/metrics/aggregation/base2_exponential_histogram_indexer.h" using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/cardinality_limit_test.cc b/sdk/test/metrics/cardinality_limit_test.cc index cf94112f1a..926062709b 100644 --- a/sdk/test/metrics/cardinality_limit_test.cc +++ b/sdk/test/metrics/cardinality_limit_test.cc @@ -1,18 +1,39 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "common.h" + +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/attributemap_hash.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/sum_aggregation.h" -#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW -# include "opentelemetry/sdk/metrics/exemplar/filter_type.h" -#endif +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" #include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" -#include -#include +#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW +# include "opentelemetry/sdk/metrics/exemplar/filter_type.h" +#endif using namespace opentelemetry::sdk::metrics; using namespace opentelemetry::common; diff --git a/sdk/test/metrics/circular_buffer_counter_test.cc b/sdk/test/metrics/circular_buffer_counter_test.cc index a8218d9e6b..38b6000d3e 100644 --- a/sdk/test/metrics/circular_buffer_counter_test.cc +++ b/sdk/test/metrics/circular_buffer_counter_test.cc @@ -1,11 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/data/circular_buffer.h" - #include +#include #include +#include "opentelemetry/sdk/metrics/data/circular_buffer.h" + using namespace opentelemetry::sdk::metrics; class AdaptingIntegerArrayTest : public testing::TestWithParam diff --git a/sdk/test/metrics/common.cc b/sdk/test/metrics/common.cc index 87343f6186..8aff2f91fa 100644 --- a/sdk/test/metrics/common.cc +++ b/sdk/test/metrics/common.cc @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 #include "common.h" +#include + +#include "opentelemetry/sdk/metrics/data/point_data.h" -using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; using namespace opentelemetry::sdk::metrics; using namespace opentelemetry::sdk::common; diff --git a/sdk/test/metrics/common.h b/sdk/test/metrics/common.h index b3b73e15d6..ff2060e285 100644 --- a/sdk/test/metrics/common.h +++ b/sdk/test/metrics/common.h @@ -3,13 +3,16 @@ #pragma once -#include "opentelemetry/sdk/metrics/data/point_data.h" +#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/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/metrics/state/metric_collector.h" -#include - class MockMetricExporter : public opentelemetry::sdk::metrics::PushMetricExporter { public: diff --git a/sdk/test/metrics/histogram_aggregation_benchmark.cc b/sdk/test/metrics/histogram_aggregation_benchmark.cc index f85a4f4706..80ebb59069 100644 --- a/sdk/test/metrics/histogram_aggregation_benchmark.cc +++ b/sdk/test/metrics/histogram_aggregation_benchmark.cc @@ -1,18 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "common.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/metrics/sync_instruments.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" -#include "opentelemetry/sdk/metrics/meter.h" -#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" -#include -#include - using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/histogram_aggregation_test.cc b/sdk/test/metrics/histogram_aggregation_test.cc index 6fd13c902c..264e223ccc 100644 --- a/sdk/test/metrics/histogram_aggregation_test.cc +++ b/sdk/test/metrics/histogram_aggregation_test.cc @@ -1,17 +1,30 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include #include "common.h" +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/metrics/sync_instruments.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" -#include "opentelemetry/sdk/metrics/meter.h" -#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" - -#include +#include "opentelemetry/sdk/metrics/view/instrument_selector.h" +#include "opentelemetry/sdk/metrics/view/meter_selector.h" +#include "opentelemetry/sdk/metrics/view/view.h" #if OPENTELEMETRY_HAVE_WORKING_REGEX diff --git a/sdk/test/metrics/histogram_test.cc b/sdk/test/metrics/histogram_test.cc index 57f7790ba1..8e0f3c1c1c 100644 --- a/sdk/test/metrics/histogram_test.cc +++ b/sdk/test/metrics/histogram_test.cc @@ -1,17 +1,31 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include #include "common.h" #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/metrics/sync_instruments.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" -#include "opentelemetry/sdk/metrics/meter.h" -#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" - -#include +#include "opentelemetry/sdk/metrics/view/instrument_selector.h" +#include "opentelemetry/sdk/metrics/view/meter_selector.h" +#include "opentelemetry/sdk/metrics/view/view.h" #if OPENTELEMETRY_HAVE_WORKING_REGEX # include diff --git a/sdk/test/metrics/instrument_metadata_validator_test.cc b/sdk/test/metrics/instrument_metadata_validator_test.cc index 28c6d4a4fd..1ecdc17025 100644 --- a/sdk/test/metrics/instrument_metadata_validator_test.cc +++ b/sdk/test/metrics/instrument_metadata_validator_test.cc @@ -1,8 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/instrument_metadata_validator.h" #include +#include +#include +#include + +#include "opentelemetry/sdk/metrics/instrument_metadata_validator.h" static std::string CreateVeryLargeString(size_t multiple) { diff --git a/sdk/test/metrics/measurements_benchmark.cc b/sdk/test/metrics/measurements_benchmark.cc index 06ac75a65a..15d96130b5 100644 --- a/sdk/test/metrics/measurements_benchmark.cc +++ b/sdk/test/metrics/measurements_benchmark.cc @@ -1,15 +1,30 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/meter.h" -#include "opentelemetry/sdk/metrics/meter_context.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/metrics/sync_instruments.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.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/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" -#include "opentelemetry/sdk/metrics/push_metric_exporter.h" - -#include -#include -#include using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; diff --git a/sdk/test/metrics/meter_provider_sdk_test.cc b/sdk/test/metrics/meter_provider_sdk_test.cc index 60ac7ab46f..36cb28c228 100644 --- a/sdk/test/metrics/meter_provider_sdk_test.cc +++ b/sdk/test/metrics/meter_provider_sdk_test.cc @@ -1,16 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include #include "common.h" -#include -#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/common/macros.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/meter.h" #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/metrics/view/instrument_selector.h" #include "opentelemetry/sdk/metrics/view/meter_selector.h" +#include "opentelemetry/sdk/metrics/view/view.h" using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/meter_test.cc b/sdk/test/metrics/meter_test.cc index cd66737465..196be7b105 100644 --- a/sdk/test/metrics/meter_test.cc +++ b/sdk/test/metrics/meter_test.cc @@ -1,16 +1,31 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "common.h" +#include "opentelemetry/metrics/async_instruments.h" +#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/nostd/shared_ptr.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/metrics/data/point_data.h" -#include "opentelemetry/sdk/metrics/meter.h" -#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" -#include - using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/metric_reader_test.cc b/sdk/test/metrics/metric_reader_test.cc index 061d505a1d..fb0c5a9cf0 100644 --- a/sdk/test/metrics/metric_reader_test.cc +++ b/sdk/test/metrics/metric_reader_test.cc @@ -1,12 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include #include "common.h" -#include +#include "opentelemetry/sdk/common/exporter_utils.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/meter_context.h" #include "opentelemetry/sdk/metrics/metric_reader.h" -#include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; diff --git a/sdk/test/metrics/multi_metric_storage_test.cc b/sdk/test/metrics/multi_metric_storage_test.cc index 97c5a438ee..e2449db9d5 100644 --- a/sdk/test/metrics/multi_metric_storage_test.cc +++ b/sdk/test/metrics/multi_metric_storage_test.cc @@ -1,18 +1,21 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/state/multi_metric_storage.h" -#include "opentelemetry/common/key_value_iterable_view.h" +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/context/context.h" +#include "opentelemetry/nostd/shared_ptr.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" #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW # include "opentelemetry/sdk/metrics/exemplar/no_exemplar_reservoir.h" #endif // ENABLE_METRICS_EXEMPLAR_PREVIEW -#include "opentelemetry/sdk/metrics/instruments.h" - -#include - using namespace opentelemetry; using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/observable_registry_test.cc b/sdk/test/metrics/observable_registry_test.cc index 6b6efb755a..23957b8275 100644 --- a/sdk/test/metrics/observable_registry_test.cc +++ b/sdk/test/metrics/observable_registry_test.cc @@ -1,11 +1,10 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/state/observable_registry.h" -#include "opentelemetry/metrics/observer_result.h" - #include +#include "opentelemetry/sdk/metrics/state/observable_registry.h" + using namespace opentelemetry::sdk::metrics; #if 0 diff --git a/sdk/test/metrics/observer_result_test.cc b/sdk/test/metrics/observer_result_test.cc index eea56738b9..73b7b86ec5 100644 --- a/sdk/test/metrics/observer_result_test.cc +++ b/sdk/test/metrics/observer_result_test.cc @@ -1,11 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/sdk/metrics/observer_result.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" -#include - using namespace opentelemetry::sdk::metrics; TEST(ObserverResult, BasicTests) { diff --git a/sdk/test/metrics/periodic_exporting_metric_reader_test.cc b/sdk/test/metrics/periodic_exporting_metric_reader_test.cc index 2eec5e8c61..50fe7f20d8 100644 --- a/sdk/test/metrics/periodic_exporting_metric_reader_test.cc +++ b/sdk/test/metrics/periodic_exporting_metric_reader_test.cc @@ -1,15 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" -#include "opentelemetry/sdk/metrics/export/metric_producer.h" -#include "opentelemetry/sdk/metrics/push_metric_exporter.h" - #include - +#include +#include #include #include +#include #include +#include +#include + +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; diff --git a/sdk/test/metrics/sum_aggregation_benchmark.cc b/sdk/test/metrics/sum_aggregation_benchmark.cc index 728b3542a1..b2e44b15e5 100644 --- a/sdk/test/metrics/sum_aggregation_benchmark.cc +++ b/sdk/test/metrics/sum_aggregation_benchmark.cc @@ -1,19 +1,31 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "common.h" +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/metrics/sync_instruments.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" -#include "opentelemetry/sdk/metrics/meter.h" -#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" -#include -#include -#include - using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/sum_aggregation_test.cc b/sdk/test/metrics/sum_aggregation_test.cc index 33a111974e..73caebbe7e 100644 --- a/sdk/test/metrics/sum_aggregation_test.cc +++ b/sdk/test/metrics/sum_aggregation_test.cc @@ -1,17 +1,35 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include #include "common.h" +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/macros.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/metrics/sync_instruments.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" -#include "opentelemetry/sdk/metrics/meter.h" -#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" - -#include +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" +#include "opentelemetry/sdk/metrics/view/instrument_selector.h" +#include "opentelemetry/sdk/metrics/view/meter_selector.h" +#include "opentelemetry/sdk/metrics/view/view.h" #if OPENTELEMETRY_HAVE_WORKING_REGEX diff --git a/sdk/test/metrics/sync_instruments_test.cc b/sdk/test/metrics/sync_instruments_test.cc index 723d29f20e..fb59e1d033 100644 --- a/sdk/test/metrics/sync_instruments_test.cc +++ b/sdk/test/metrics/sync_instruments_test.cc @@ -1,15 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/sync_instruments.h" +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" #include "opentelemetry/context/context.h" +#include "opentelemetry/nostd/utility.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" -#include "opentelemetry/sdk/metrics/exemplar/no_exemplar_reservoir.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" +#include "opentelemetry/sdk/metrics/state/metric_storage.h" #include "opentelemetry/sdk/metrics/state/multi_metric_storage.h" - -#include -#include -#include +#include "opentelemetry/sdk/metrics/sync_instruments.h" using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; diff --git a/sdk/test/metrics/sync_metric_storage_counter_test.cc b/sdk/test/metrics/sync_metric_storage_counter_test.cc index 2593b69719..c67b9d499a 100644 --- a/sdk/test/metrics/sync_metric_storage_counter_test.cc +++ b/sdk/test/metrics/sync_metric_storage_counter_test.cc @@ -1,25 +1,35 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "common.h" -#include +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/key_value_iterable_view.h" #include "opentelemetry/context/context.h" -#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" +#include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" #if ENABLE_METRICS_EXEMPLAR_PREVIEW # include "opentelemetry/sdk/metrics/exemplar/filter_type.h" # include "opentelemetry/sdk/metrics/exemplar/reservoir.h" #endif -#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 - using namespace opentelemetry::sdk::metrics; using namespace opentelemetry::common; using M = std::map; diff --git a/sdk/test/metrics/sync_metric_storage_histogram_test.cc b/sdk/test/metrics/sync_metric_storage_histogram_test.cc index 71a16b85c6..34145743d9 100644 --- a/sdk/test/metrics/sync_metric_storage_histogram_test.cc +++ b/sdk/test/metrics/sync_metric_storage_histogram_test.cc @@ -1,24 +1,35 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "common.h" +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/key_value_iterable_view.h" -#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" +#include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW # include "opentelemetry/sdk/metrics/exemplar/filter_type.h" # include "opentelemetry/sdk/metrics/exemplar/reservoir.h" #endif -#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 - using namespace opentelemetry::sdk::metrics; using namespace opentelemetry::common; using M = std::map; diff --git a/sdk/test/metrics/sync_metric_storage_up_down_counter_test.cc b/sdk/test/metrics/sync_metric_storage_up_down_counter_test.cc index 88ae56eb3f..4732e5b9f2 100644 --- a/sdk/test/metrics/sync_metric_storage_up_down_counter_test.cc +++ b/sdk/test/metrics/sync_metric_storage_up_down_counter_test.cc @@ -1,22 +1,33 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "common.h" +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/key_value_iterable_view.h" -#include "opentelemetry/nostd/shared_ptr.h" - -#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW -# include "opentelemetry/sdk/metrics/exemplar/filter_type.h" -#endif - +#include "opentelemetry/context/context.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" #include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" -#include -#include -#include +#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW +# include "opentelemetry/sdk/metrics/exemplar/filter_type.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 fb188e7124..0135227e16 100644 --- a/sdk/test/metrics/view_registry_test.cc +++ b/sdk/test/metrics/view_registry_test.cc @@ -1,12 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/view/view_registry.h" +#include +#include +#include +#include + +#include "opentelemetry/common/macros.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/metrics/instruments.h" -#include "opentelemetry/sdk/metrics/view/predicate.h" - -#include +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" +#include "opentelemetry/sdk/metrics/view/instrument_selector.h" +#include "opentelemetry/sdk/metrics/view/meter_selector.h" +#include "opentelemetry/sdk/metrics/view/view.h" +#include "opentelemetry/sdk/metrics/view/view_registry.h" #if OPENTELEMETRY_HAVE_WORKING_REGEX # include diff --git a/sdk/test/resource/resource_test.cc b/sdk/test/resource/resource_test.cc index 419264862c..c15087e9b7 100644 --- a/sdk/test/resource/resource_test.cc +++ b/sdk/test/resource/resource_test.cc @@ -1,17 +1,21 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/common/attribute_utils.h" -#include "opentelemetry/sdk/resource/resource_detector.h" -#include "opentelemetry/sdk/resource/semantic_conventions.h" -#include "opentelemetry/sdk/version/version.h" - +#include +#include #include #include #include +#include +#include -#include +#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/sdk/resource/resource_detector.h" +#include "opentelemetry/sdk/resource/semantic_conventions.h" +#include "opentelemetry/sdk/version/version.h" #if defined(_MSC_VER) # include "opentelemetry/sdk/common/env_variables.h" diff --git a/sdk/test/trace/always_off_sampler_test.cc b/sdk/test/trace/always_off_sampler_test.cc index 1c32bd5a8f..5680e22c75 100644 --- a/sdk/test/trace/always_off_sampler_test.cc +++ b/sdk/test/trace/always_off_sampler_test.cc @@ -2,8 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_off.h" +#include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_context_kv_iterable_view.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/trace_state.h" using opentelemetry::sdk::trace::AlwaysOffSampler; using opentelemetry::sdk::trace::Decision; diff --git a/sdk/test/trace/always_on_sampler_test.cc b/sdk/test/trace/always_on_sampler_test.cc index c483f9b8be..04b7e60a2b 100644 --- a/sdk/test/trace/always_on_sampler_test.cc +++ b/sdk/test/trace/always_on_sampler_test.cc @@ -1,12 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" +#include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_context_kv_iterable_view.h" - -#include -#include +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/trace_state.h" using namespace opentelemetry::sdk::trace; using namespace opentelemetry::nostd; diff --git a/sdk/test/trace/batch_span_processor_test.cc b/sdk/test/trace/batch_span_processor_test.cc index 9bb09d6e55..293747350a 100644 --- a/sdk/test/trace/batch_span_processor_test.cc +++ b/sdk/test/trace/batch_span_processor_test.cc @@ -1,22 +1,28 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/batch_span_processor.h" -#include "opentelemetry/sdk/common/exporter_utils.h" -#include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk/trace/batch_span_processor_options.h" -#include "opentelemetry/sdk/trace/exporter.h" -#include "opentelemetry/sdk/trace/span_data.h" -#include "opentelemetry/sdk/trace/tracer.h" - #include - #include +#include #include -#include -#include +#include +#include #include #include +#include + +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/common/global_log_handler.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/span_data.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/test/trace/parent_sampler_test.cc b/sdk/test/trace/parent_sampler_test.cc index 7d2ef7f107..a6ed8ff7f8 100644 --- a/sdk/test/trace/parent_sampler_test.cc +++ b/sdk/test/trace/parent_sampler_test.cc @@ -2,11 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/context/context_value.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_off.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" #include "opentelemetry/sdk/trace/samplers/parent.h" +#include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_context_kv_iterable_view.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" using opentelemetry::sdk::trace::AlwaysOffSampler; using opentelemetry::sdk::trace::AlwaysOnSampler; diff --git a/sdk/test/trace/sampler_benchmark.cc b/sdk/test/trace/sampler_benchmark.cc index ec188b84a1..529143b53e 100644 --- a/sdk/test/trace/sampler_benchmark.cc +++ b/sdk/test/trace/sampler_benchmark.cc @@ -1,20 +1,34 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable_view.h" #include "opentelemetry/exporters/memory/in_memory_span_exporter.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/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_off.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" #include "opentelemetry/sdk/trace/samplers/parent.h" #include "opentelemetry/sdk/trace/samplers/trace_id_ratio.h" #include "opentelemetry/sdk/trace/simple_processor.h" -#include "opentelemetry/sdk/trace/span_data.h" #include "opentelemetry/sdk/trace/tracer.h" - -#include - -#include +#include "opentelemetry/sdk/trace/tracer_context.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_context_kv_iterable_view.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/tracer.h" using namespace opentelemetry::sdk::trace; using opentelemetry::exporter::memory::InMemorySpanExporter; diff --git a/sdk/test/trace/simple_processor_test.cc b/sdk/test/trace/simple_processor_test.cc index 7653bb2cfc..92fdf71d58 100644 --- a/sdk/test/trace/simple_processor_test.cc +++ b/sdk/test/trace/simple_processor_test.cc @@ -1,13 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/simple_processor.h" +#include +#include +#include +#include +#include + +#include "opentelemetry/exporters/memory/in_memory_span_data.h" #include "opentelemetry/exporters/memory/in_memory_span_exporter.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/atomic_unique_ptr.h" +#include "opentelemetry/sdk/common/exporter_utils.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 +#include "opentelemetry/trace/span_context.h" using namespace opentelemetry::sdk::trace; using namespace opentelemetry::sdk::common; diff --git a/sdk/test/trace/span_data_test.cc b/sdk/test/trace/span_data_test.cc index 6dfc09bd12..054af65330 100644 --- a/sdk/test/trace/span_data_test.cc +++ b/sdk/test/trace/span_data_test.cc @@ -1,18 +1,32 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/span_data.h" +#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/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" #include "opentelemetry/nostd/variant.h" -#include "opentelemetry/trace/span.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/span_data.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 +#include "opentelemetry/trace/trace_state.h" using opentelemetry::sdk::trace::SpanData; namespace trace_api = opentelemetry::trace; namespace common = opentelemetry::common; -namespace nostd = opentelemetry::nostd; TEST(SpanData, DefaultValues) { @@ -70,7 +84,7 @@ TEST(SpanData, Set) ASSERT_EQ(data.GetDescription(), "description"); ASSERT_EQ(data.GetStartTime().time_since_epoch(), now.time_since_epoch()); ASSERT_EQ(data.GetDuration(), std::chrono::nanoseconds(1000000)); - ASSERT_EQ(nostd::get(data.GetAttributes().at("attr1")), 314159); + ASSERT_EQ(opentelemetry::nostd::get(data.GetAttributes().at("attr1")), 314159); ASSERT_EQ(data.GetEvents().at(0).GetName(), "event1"); ASSERT_EQ(data.GetEvents().at(0).GetTimestamp(), now); } @@ -89,7 +103,9 @@ TEST(SpanData, EventAttributes) for (int i = 0; i < kNumAttributes; i++) { - EXPECT_EQ(nostd::get(data.GetEvents().at(0).GetAttributes().at(keys[i])), values[i]); + EXPECT_EQ( + opentelemetry::nostd::get(data.GetEvents().at(0).GetAttributes().at(keys[i])), + values[i]); } } @@ -130,6 +146,7 @@ TEST(SpanData, Links) EXPECT_EQ(data.GetLinks().at(0).GetSpanContext(), span_context); for (int i = 0; i < kNumAttributes; i++) { - EXPECT_EQ(nostd::get(data.GetLinks().at(0).GetAttributes().at(keys[i])), values[i]); + EXPECT_EQ(opentelemetry::nostd::get(data.GetLinks().at(0).GetAttributes().at(keys[i])), + values[i]); } } diff --git a/sdk/test/trace/trace_id_ratio_sampler_test.cc b/sdk/test/trace/trace_id_ratio_sampler_test.cc index 1b0088f134..ac83a8dc6d 100644 --- a/sdk/test/trace/trace_id_ratio_sampler_test.cc +++ b/sdk/test/trace/trace_id_ratio_sampler_test.cc @@ -1,14 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/trace_id_ratio.h" +#include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_context_kv_iterable_view.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 "src/common/random.h" -#include -#include -#include - using opentelemetry::sdk::common::Random; using opentelemetry::sdk::trace::Decision; using opentelemetry::sdk::trace::TraceIdRatioBasedSampler; diff --git a/sdk/test/trace/tracer_provider_test.cc b/sdk/test/trace/tracer_provider_test.cc index 9715a7e0b8..fa3afa2690 100644 --- a/sdk/test/trace/tracer_provider_test.cc +++ b/sdk/test/trace/tracer_provider_test.cc @@ -1,20 +1,31 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/tracer_provider.h" +#include +#include +#include +#include + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/random_id_generator.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_off.h" -#include "opentelemetry/sdk/trace/samplers/always_on.h" #include "opentelemetry/sdk/trace/simple_processor.h" #include "opentelemetry/sdk/trace/tracer.h" - -#include +#include "opentelemetry/sdk/trace/tracer_context.h" +#include "opentelemetry/sdk/trace/tracer_provider.h" using namespace opentelemetry::sdk::trace; using namespace opentelemetry::sdk::resource; -#include - TEST(TracerProvider, GetTracer) { std::unique_ptr processor(new SimpleSpanProcessor(nullptr)); diff --git a/sdk/test/trace/tracer_test.cc b/sdk/test/trace/tracer_test.cc index c57b638e3d..2c4de8e83c 100644 --- a/sdk/test/trace/tracer_test.cc +++ b/sdk/test/trace/tracer_test.cc @@ -1,17 +1,58 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/tracer.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/macros.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/context/context_value.h" +#include "opentelemetry/exporters/memory/in_memory_span_data.h" #include "opentelemetry/exporters/memory/in_memory_span_exporter.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/nostd/utility.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/random_id_generator.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_off.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" #include "opentelemetry/sdk/trace/samplers/parent.h" #include "opentelemetry/sdk/trace/simple_processor.h" #include "opentelemetry/sdk/trace/span_data.h" +#include "opentelemetry/sdk/trace/tracer.h" +#include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/trace/context.h" - -#include +#include "opentelemetry/trace/scope.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_context_kv_iterable.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/span_startoptions.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/trace_state.h" +#include "opentelemetry/trace/tracer.h" using namespace opentelemetry::sdk::trace; using namespace opentelemetry::sdk::resource; diff --git a/test_common/include/opentelemetry/test_common/ext/http/client/http_client_test_factory.h b/test_common/include/opentelemetry/test_common/ext/http/client/http_client_test_factory.h index 51f9502bb8..eb56b59806 100644 --- a/test_common/include/opentelemetry/test_common/ext/http/client/http_client_test_factory.h +++ b/test_common/include/opentelemetry/test_common/ext/http/client/http_client_test_factory.h @@ -2,7 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 #pragma once + +#include + #include "opentelemetry/ext/http/client/http_client.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace ext diff --git a/test_common/include/opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h b/test_common/include/opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h index 3207857743..a5f8c2f0e1 100644 --- a/test_common/include/opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h +++ b/test_common/include/opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h @@ -3,16 +3,18 @@ #pragma once -#include "opentelemetry/ext/http/client/http_client.h" -#include "opentelemetry/ext/http/common/url_parser.h" -#include "opentelemetry/version.h" - -#include +#include +#include +#include +#include +#include #include -#include +#include -#include -#include "gmock/gmock.h" +#include "opentelemetry/ext/http/client/http_client.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace ext @@ -116,7 +118,7 @@ class Response : public opentelemetry::ext::http::client::Response opentelemetry::ext::http::client::StatusCode status_code_; }; -class HttpClient; +class HttpClient; // IWYU pragma: keep class Session : public opentelemetry::ext::http::client::Session { diff --git a/test_common/src/http/client/nosend/http_client_nosend.cc b/test_common/src/http/client/nosend/http_client_nosend.cc index 98cae0476a..46784869c4 100644 --- a/test_common/src/http/client/nosend/http_client_nosend.cc +++ b/test_common/src/http/client/nosend/http_client_nosend.cc @@ -1,7 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/ext/http/client/http_client.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace ext