From 62b71970e5ca0e1331a5d4d87980ee56f881f34c Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 13 Jan 2025 22:51:47 +0100 Subject: [PATCH] [Code Health] Include what you use, part 7 (#3238) --- .github/workflows/iwyu.yml | 12 +++-- CMakeLists.txt | 10 ++++ ci/do_ci.sh | 20 -------- cmake/opentelemetry-proto.cmake | 3 ++ examples/grpc/CMakeLists.txt | 3 ++ examples/grpc/client.cc | 24 ++++++++-- examples/grpc/server.cc | 46 ++++++++++++------- examples/otlp/http_instrumented_main.cc | 15 +++--- examples/prometheus/main.cc | 13 ++++-- .../exporters/otlp/otlp_grpc_client_factory.h | 6 +-- .../exporters/otlp/otlp_grpc_utils.h | 4 +- exporters/otlp/src/otlp_file_client.cc | 4 ++ exporters/otlp/src/otlp_http_exporter.cc | 1 + exporters/otlp/test/otlp_file_client_test.cc | 2 + .../test/otlp_grpc_exporter_factory_test.cc | 5 +- ...p_grpc_log_record_exporter_factory_test.cc | 5 +- .../otlp_grpc_metric_exporter_factory_test.cc | 5 +- .../test/otlp_http_metric_exporter_test.cc | 4 +- .../otlp/test/otlp_log_recordable_test.cc | 1 + exporters/otlp/test/otlp_recordable_test.cc | 1 + .../exporters/prometheus/collector.h | 7 ++- .../exporters/prometheus/exporter.h | 9 ++-- exporters/prometheus/src/collector.cc | 10 ++++ exporters/prometheus/src/exporter.cc | 11 +++++ exporters/prometheus/src/exporter_factory.cc | 3 +- exporters/prometheus/src/exporter_utils.cc | 22 +++++++-- exporters/prometheus/test/collector_test.cc | 16 ++++--- exporters/prometheus/test/exporter_test.cc | 5 +- .../prometheus/test/exporter_utils_test.cc | 18 ++++++-- .../prometheus/test/prometheus_test_helper.h | 2 + .../opentracingshim/propagation.h | 5 +- .../opentracingshim/shim_utils.h | 29 ++++++++++-- .../opentracingshim/span_context_shim.h | 9 +++- .../opentelemetry/opentracingshim/span_shim.h | 20 ++++++-- .../opentracingshim/tracer_shim.h | 13 +++++- opentracing-shim/src/shim_utils.cc | 21 ++++++++- opentracing-shim/src/span_context_shim.cc | 14 ++++++ opentracing-shim/src/span_shim.cc | 26 +++++++++-- opentracing-shim/src/tracer_shim.cc | 34 ++++++++++++-- opentracing-shim/test/propagation_test.cc | 20 ++++++-- opentracing-shim/test/shim_mocks.h | 9 ++-- opentracing-shim/test/shim_utils_test.cc | 37 +++++++++++++-- .../test/span_context_shim_test.cc | 19 ++++++-- opentracing-shim/test/span_shim_test.cc | 31 +++++++++++-- opentracing-shim/test/tracer_shim_test.cc | 42 ++++++++++++++--- sdk/src/logs/batch_log_record_processor.cc | 1 - .../periodic_exporting_metric_reader.cc | 1 - sdk/src/trace/batch_span_processor.cc | 1 - 48 files changed, 476 insertions(+), 143 deletions(-) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index ae4c5fb96b..2aa91e0741 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -31,6 +31,10 @@ jobs: libgtest-dev \ libbenchmark-dev + - name: setup grpc + run: | + sudo ./ci/setup_grpc.sh + - name: Prepare CMake run: | TOPDIR=`pwd` @@ -41,12 +45,14 @@ jobs: -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \ -DBUILD_TESTING=ON \ -DBUILD_W3CTRACECONTEXT_TEST=ON \ - -DWITH_OTLP_GRPC=OFF \ + -DWITH_OTLP_GRPC=ON \ -DWITH_OTLP_HTTP=ON \ -DWITH_OTLP_FILE=ON \ + -DWITH_OPENTRACING=ON \ -DWITH_OTLP_HTTP_COMPRESSION=ON \ + -DWITH_THREAD_INSTRUMENTATION=ON \ -DWITH_ZIPKIN=ON \ - -DWITH_PROMETHEUS=OFF \ + -DWITH_PROMETHEUS=ON \ .. - name: iwyu_tool @@ -67,7 +73,7 @@ jobs: readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log` echo "include-what-you-use reported ${WARNING_COUNT} warning(s)" # Acceptable limit, to decrease over time down to 0 - readonly WARNING_LIMIT=180 + readonly WARNING_LIMIT=10 # FAIL the build if WARNING_COUNT > WARNING_LIMIT if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then exit 1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c0f4d4a18..aa76c997bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -369,11 +369,16 @@ if(WITH_PROMETHEUS) if(EXISTS ${PROJECT_SOURCE_DIR}/third_party/prometheus-cpp/.git) set(SAVED_ENABLE_TESTING ${ENABLE_TESTING}) set(SAVED_CMAKE_CXX_CLANG_TIDY ${CMAKE_CXX_CLANG_TIDY}) + set(SAVED_CMAKE_CXX_INCLUDE_WHAT_YOU_USE + ${CMAKE_CXX_INCLUDE_WHAT_YOU_USE}) set(ENABLE_TESTING OFF) set(CMAKE_CXX_CLANG_TIDY "") + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "") add_subdirectory(third_party/prometheus-cpp) set(ENABLE_TESTING ${SAVED_ENABLE_TESTING}) set(CMAKE_CXX_CLANG_TIDY ${SAVED_CMAKE_CXX_CLANG_TIDY}) + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE + ${SAVED_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}) else() message( FATAL_ERROR @@ -715,8 +720,13 @@ if(WITH_OPENTRACING) if(EXISTS "${PROJECT_SOURCE_DIR}/${OPENTRACING_DIR}/.git") set(SAVED_BUILD_TESTING ${BUILD_TESTING}) set(BUILD_TESTING OFF) + set(SAVED_CMAKE_CXX_INCLUDE_WHAT_YOU_USE + ${CMAKE_CXX_INCLUDE_WHAT_YOU_USE}) + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "") add_subdirectory(${OPENTRACING_DIR}) set(BUILD_TESTING ${SAVED_BUILD_TESTING}) + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE + ${SAVED_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}) else() message( FATAL_ERROR diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 1e5dd59899..1fd1a37f80 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -63,20 +63,9 @@ mkdir -p "${BUILD_DIR}" [ -z "${PLUGIN_DIR}" ] && export PLUGIN_DIR=$HOME/plugin mkdir -p "${PLUGIN_DIR}" -IWYU="" MAKE_COMMAND="make -k -j \$(nproc)" -# Temporarily disable the IWYU build. -# It fails in Ubuntu 24-04 CI with: -# Error running 'iwyu': Segmentation fault -# -# if [[ "${CXX}" == *clang* ]]; then -# MAKE_COMMAND="make -k CXX=include-what-you-use CXXFLAGS=\"-Xiwyu --error_always\" -j \$(nproc)" -# IWYU="-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=iwyu" -# fi - echo "make command: ${MAKE_COMMAND}" -echo "IWYU option: ${IWYU}" BAZEL_OPTIONS_DEFAULT="--copt=-DENABLE_METRICS_EXEMPLAR_PREVIEW" BAZEL_OPTIONS="$BAZEL_OPTIONS_DEFAULT" @@ -132,7 +121,6 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then -DWITH_NO_DEPRECATED_CODE=ON \ -DWITH_OTLP_HTTP_COMPRESSION=ON \ -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test @@ -155,7 +143,6 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then -DWITH_NO_DEPRECATED_CODE=ON \ -DWITH_OTLP_HTTP_COMPRESSION=ON \ -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test @@ -203,7 +190,6 @@ elif [[ "$1" == "cmake.maintainer.abiv2.test" ]]; then -DWITH_ABI_VERSION_2=ON \ -DWITH_OTLP_HTTP_COMPRESSION=ON \ -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test @@ -251,7 +237,6 @@ elif [[ "$1" == "cmake.c++20.test" ]]; then -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ -DWITH_STL=CXX20 \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test @@ -263,7 +248,6 @@ elif [[ "$1" == "cmake.c++23.test" ]]; then -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ -DWITH_STL=CXX23 \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test @@ -276,7 +260,6 @@ elif [[ "$1" == "cmake.c++14.stl.test" ]]; then -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ -DWITH_STL=CXX14 \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test @@ -289,7 +272,6 @@ elif [[ "$1" == "cmake.c++17.stl.test" ]]; then -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ -DWITH_STL=CXX17 \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test @@ -302,7 +284,6 @@ elif [[ "$1" == "cmake.c++20.stl.test" ]]; then -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ -DWITH_STL=CXX20 \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test @@ -315,7 +296,6 @@ elif [[ "$1" == "cmake.c++23.stl.test" ]]; then -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ -DWITH_STL=CXX23 \ - ${IWYU} \ "${SRC_DIR}" eval "$MAKE_COMMAND" make test diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake index 0ff346d249..2f7431e02a 100644 --- a/cmake/opentelemetry-proto.cmake +++ b/cmake/opentelemetry-proto.cmake @@ -342,6 +342,9 @@ if(WITH_OTLP_GRPC) ${LOGS_SERVICE_GRPC_PB_CPP_FILE} ${METRICS_SERVICE_GRPC_PB_CPP_FILE}) set_target_version(opentelemetry_proto_grpc) + # Disable include-what-you-use on generated code. + set_target_properties(opentelemetry_proto_grpc PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "") + list(APPEND OPENTELEMETRY_PROTO_TARGETS opentelemetry_proto_grpc) target_link_libraries(opentelemetry_proto_grpc PUBLIC opentelemetry_proto) diff --git a/examples/grpc/CMakeLists.txt b/examples/grpc/CMakeLists.txt index 21325663ab..015f4a2287 100644 --- a/examples/grpc/CMakeLists.txt +++ b/examples/grpc/CMakeLists.txt @@ -25,6 +25,9 @@ add_library(example_grpc_proto ${example_grpc_srcs} ${example_grpc_hdrs} patch_protobuf_targets(example_grpc_proto) +# Disable include-what-you-use on generated code. +set_target_properties(example_grpc_proto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "") + include_directories( ${CMAKE_SOURCE_DIR}/exporters/ostream/include ${CMAKE_SOURCE_DIR}/ext/include ${CMAKE_SOURCE_DIR}/api/include/ ${CMAKE_SOURCE_DIR/}) diff --git a/examples/grpc/client.cc b/examples/grpc/client.cc index 49be22c155..ab11d86045 100644 --- a/examples/grpc/client.cc +++ b/examples/grpc/client.cc @@ -5,16 +5,32 @@ // ambiguity with `nostd::variant` if compiled with Visual Studio 2015. Other // modern compilers are unaffected. #include +#include +#include + +#include +#include +#include +#include +#include +#include "opentelemetry/context/propagation/global_propagator.h" +#include "opentelemetry/context/propagation/text_map_propagator.h" +#include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/trace/propagation/http_trace_context.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/span_startoptions.h" +#include "opentelemetry/trace/tracer.h" + #ifdef BAZEL_BUILD # include "examples/grpc/protos/messages.grpc.pb.h" +# include "examples/grpc/protos/messages.pb.h" #else # include "messages.grpc.pb.h" +# include "messages.pb.h" #endif -#include -#include -#include - #include "opentelemetry/semconv/incubating/rpc_attributes.h" #include "opentelemetry/semconv/network_attributes.h" #include "tracer_common.h" diff --git a/examples/grpc/server.cc b/examples/grpc/server.cc index 6aa543a8a1..1c23b27a0d 100644 --- a/examples/grpc/server.cc +++ b/examples/grpc/server.cc @@ -1,28 +1,40 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#ifdef BAZEL_BUILD -# include "examples/grpc/protos/messages.grpc.pb.h" -#else -# include "messages.grpc.pb.h" -#endif - -#include "opentelemetry/semconv/incubating/rpc_attributes.h" -#include "opentelemetry/trace/context.h" -#include "opentelemetry/trace/span_context_kv_iterable_view.h" -#include "tracer_common.h" - -#include +#include #include #include #include - -#include -#include +#include +#include +#include +#include +#include #include -#include #include -#include +#include + +#include "opentelemetry/context/propagation/global_propagator.h" +#include "opentelemetry/context/propagation/text_map_propagator.h" +#include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/semconv/incubating/rpc_attributes.h" +#include "opentelemetry/trace/context.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/span_startoptions.h" +#include "opentelemetry/trace/tracer.h" +#include "tracer_common.h" + +#ifdef BAZEL_BUILD +# include "examples/grpc/protos/messages.grpc.pb.h" +# include "examples/grpc/protos/messages.pb.h" +#else +# include "messages.grpc.pb.h" +# include "messages.pb.h" +#endif using grpc::Server; using grpc::ServerBuilder; diff --git a/examples/otlp/http_instrumented_main.cc b/examples/otlp/http_instrumented_main.cc index 39bbea98e7..19f7a2d572 100644 --- a/examples/otlp/http_instrumented_main.cc +++ b/examples/otlp/http_instrumented_main.cc @@ -6,8 +6,6 @@ #include #include -#include "opentelemetry/exporters/otlp/otlp_environment.h" -#include "opentelemetry/exporters/otlp/otlp_http.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_runtime_options.h" @@ -17,7 +15,6 @@ #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_runtime_options.h" -#include "opentelemetry/logs/log_record.h" #include "opentelemetry/logs/logger_provider.h" #include "opentelemetry/logs/provider.h" #include "opentelemetry/metrics/meter_provider.h" @@ -25,7 +22,6 @@ #include "opentelemetry/sdk/logs/batch_log_record_processor_factory.h" #include "opentelemetry/sdk/logs/logger_provider.h" #include "opentelemetry/sdk/logs/logger_provider_factory.h" -#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_runtime_options.h" @@ -38,13 +34,20 @@ #include "opentelemetry/sdk/trace/batch_span_processor_options.h" #include "opentelemetry/sdk/trace/batch_span_processor_runtime_options.h" #include "opentelemetry/sdk/trace/processor.h" -#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" -#include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/tracer_provider.h" +#include +#include +#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h" +#include "opentelemetry/sdk/logs/batch_log_record_processor_runtime_options.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/metrics/meter_provider.h" +#include "opentelemetry/sdk/trace/exporter.h" + #ifdef BAZEL_BUILD # include "examples/common/logs_foo_library/foo_library.h" # include "examples/common/metrics_foo_library/foo_library.h" diff --git a/examples/prometheus/main.cc b/examples/prometheus/main.cc index 8a559f0f57..5af0294066 100644 --- a/examples/prometheus/main.cc +++ b/examples/prometheus/main.cc @@ -1,19 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include +#include +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/exporters/prometheus/exporter_factory.h" #include "opentelemetry/exporters/prometheus/exporter_options.h" +#include "opentelemetry/metrics/meter_provider.h" #include "opentelemetry/metrics/provider.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" -#include "opentelemetry/sdk/metrics/meter.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/meter_provider_factory.h" +#include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/metrics/view/instrument_selector.h" #include "opentelemetry/sdk/metrics/view/instrument_selector_factory.h" +#include "opentelemetry/sdk/metrics/view/meter_selector.h" #include "opentelemetry/sdk/metrics/view/meter_selector_factory.h" +#include "opentelemetry/sdk/metrics/view/view.h" #include "opentelemetry/sdk/metrics/view/view_factory.h" #ifdef BAZEL_BUILD diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client_factory.h index ded0eadd8e..133f4643e0 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client_factory.h @@ -5,8 +5,9 @@ #include +#include "opentelemetry/exporters/otlp/otlp_grpc_client.h" #include "opentelemetry/exporters/otlp/otlp_grpc_client_options.h" -#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter @@ -14,9 +15,6 @@ namespace exporter namespace otlp { -class OtlpGrpcClientReferenceGuard; -class OtlpGrpcClient; - /** * Factory class for OtlpGrpcClient. */ diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_utils.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_utils.h index 504b0e9df3..a5e4e018fa 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_utils.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_utils.h @@ -3,9 +3,9 @@ #pragma once -#include +#include -#include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/src/otlp_file_client.cc b/exporters/otlp/src/otlp_file_client.cc index e59cbb04be..dab212871c 100644 --- a/exporters/otlp/src/otlp_file_client.cc +++ b/exporters/otlp/src/otlp_file_client.cc @@ -20,6 +20,8 @@ #include #include +// IWYU pragma: no_include + #if defined(HAVE_GSL) # include #else @@ -60,6 +62,7 @@ # include # include +# include # include # define FS_ACCESS(x) access(x, F_OK) @@ -111,6 +114,7 @@ #include "opentelemetry/sdk/common/base64.h" #include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/common/thread_instrumentation.h" #include "opentelemetry/version.h" // clang-format off diff --git a/exporters/otlp/src/otlp_http_exporter.cc b/exporters/otlp/src/otlp_http_exporter.cc index 0514a2d036..95383d164a 100644 --- a/exporters/otlp/src/otlp_http_exporter.cc +++ b/exporters/otlp/src/otlp_http_exporter.cc @@ -19,6 +19,7 @@ #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/common/thread_instrumentation.h" #include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/version.h" diff --git a/exporters/otlp/test/otlp_file_client_test.cc b/exporters/otlp/test/otlp_file_client_test.cc index 502dd26a88..20ba905c47 100644 --- a/exporters/otlp/test/otlp_file_client_test.cc +++ b/exporters/otlp/test/otlp_file_client_test.cc @@ -16,6 +16,8 @@ #include #include +// IWYU pragma: no_include + #include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_file_client.h" #include "opentelemetry/exporters/otlp/otlp_file_client_options.h" diff --git a/exporters/otlp/test/otlp_grpc_exporter_factory_test.cc b/exporters/otlp/test/otlp_grpc_exporter_factory_test.cc index a2fb62dab0..8885c3e947 100644 --- a/exporters/otlp/test/otlp_grpc_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_grpc_exporter_factory_test.cc @@ -3,7 +3,6 @@ #include -#include "opentelemetry/exporters/otlp/otlp_grpc_client_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h" @@ -15,6 +14,10 @@ # error "protobuf should not be included" #endif +/* + Implementation, this requires protobuf. +*/ +#include "opentelemetry/exporters/otlp/otlp_grpc_client_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_exporter.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/test/otlp_grpc_log_record_exporter_factory_test.cc b/exporters/otlp/test/otlp_grpc_log_record_exporter_factory_test.cc index 0d0ab17d62..8e8261334c 100644 --- a/exporters/otlp/test/otlp_grpc_log_record_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_grpc_log_record_exporter_factory_test.cc @@ -3,7 +3,6 @@ #include -#include "opentelemetry/exporters/otlp/otlp_grpc_client_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_options.h" @@ -15,6 +14,10 @@ # error "protobuf should not be included" #endif +/* + Implementation, this requires protobuf. +*/ +#include "opentelemetry/exporters/otlp/otlp_grpc_client_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/test/otlp_grpc_metric_exporter_factory_test.cc b/exporters/otlp/test/otlp_grpc_metric_exporter_factory_test.cc index ecad49bee1..76af86b1bb 100644 --- a/exporters/otlp/test/otlp_grpc_metric_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_grpc_metric_exporter_factory_test.cc @@ -3,7 +3,6 @@ #include -#include "opentelemetry/exporters/otlp/otlp_grpc_client_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_options.h" @@ -15,6 +14,10 @@ # error "protobuf should not be included" #endif +/* + Implementation, this requires protobuf. +*/ +#include "opentelemetry/exporters/otlp/otlp_grpc_client_factory.h" #include "opentelemetry/exporters/otlp/otlp_grpc_metric_exporter.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/test/otlp_http_metric_exporter_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_test.cc index 6db657d50b..420946ff70 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_test.cc @@ -1,9 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include #include -#include #include #include #include @@ -13,6 +11,7 @@ #include #include #include +#include "gmock/gmock.h" #include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/otlp/otlp_environment.h" @@ -40,6 +39,7 @@ // clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +// IWYU pragma: no_include "net/proto2/public/repeated_field.h" #include #include "opentelemetry/proto/collector/metrics/v1/metrics_service.pb.h" #include "opentelemetry/proto/common/v1/common.pb.h" diff --git a/exporters/otlp/test/otlp_log_recordable_test.cc b/exporters/otlp/test/otlp_log_recordable_test.cc index b2e965b185..571f600b22 100644 --- a/exporters/otlp/test/otlp_log_recordable_test.cc +++ b/exporters/otlp/test/otlp_log_recordable_test.cc @@ -24,6 +24,7 @@ // clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +// IWYU pragma: no_include "net/proto2/public/repeated_field.h" #include "opentelemetry/proto/common/v1/common.pb.h" #include "opentelemetry/proto/logs/v1/logs.pb.h" #include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep diff --git a/exporters/otlp/test/otlp_recordable_test.cc b/exporters/otlp/test/otlp_recordable_test.cc index 8309811ae0..c2449c2c25 100644 --- a/exporters/otlp/test/otlp_recordable_test.cc +++ b/exporters/otlp/test/otlp_recordable_test.cc @@ -38,6 +38,7 @@ // clang-format off #include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" // IWYU pragma: keep +// IWYU pragma: no_include "net/proto2/public/repeated_field.h" #include "opentelemetry/proto/collector/trace/v1/trace_service.pb.h" #include "opentelemetry/proto/common/v1/common.pb.h" #include "opentelemetry/proto/resource/v1/resource.pb.h" diff --git a/exporters/prometheus/include/opentelemetry/exporters/prometheus/collector.h b/exporters/prometheus/include/opentelemetry/exporters/prometheus/collector.h index cb94fe7654..12cc26e6f8 100644 --- a/exporters/prometheus/include/opentelemetry/exporters/prometheus/collector.h +++ b/exporters/prometheus/include/opentelemetry/exporters/prometheus/collector.h @@ -3,14 +3,13 @@ #pragma once -#include +#include +#include #include #include -#include -#include -#include "opentelemetry/exporters/prometheus/exporter_utils.h" #include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/version.h" namespace prometheus_client = ::prometheus; diff --git a/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter.h b/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter.h index 34bdc4a0f8..3cdca002fc 100644 --- a/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter.h +++ b/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter.h @@ -3,16 +3,13 @@ #pragma once -#include -#include -#include - #include +#include +#include #include "opentelemetry/exporters/prometheus/collector.h" #include "opentelemetry/exporters/prometheus/exporter_options.h" -#include "opentelemetry/nostd/span.h" -#include "opentelemetry/sdk/common/env_variables.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/version.h" diff --git a/exporters/prometheus/src/collector.cc b/exporters/prometheus/src/collector.cc index 53d880ee01..2387baf578 100644 --- a/exporters/prometheus/src/collector.cc +++ b/exporters/prometheus/src/collector.cc @@ -1,8 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include + #include "opentelemetry/exporters/prometheus/collector.h" +#include "opentelemetry/exporters/prometheus/exporter_utils.h" +#include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/version.h" namespace metric_sdk = opentelemetry::sdk::metrics; diff --git a/exporters/prometheus/src/exporter.cc b/exporters/prometheus/src/exporter.cc index eeab82d6bb..12fef5acd9 100644 --- a/exporters/prometheus/src/exporter.cc +++ b/exporters/prometheus/src/exporter.cc @@ -1,8 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/exporters/prometheus/collector.h" #include "opentelemetry/exporters/prometheus/exporter.h" +#include "opentelemetry/exporters/prometheus/exporter_options.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/prometheus/src/exporter_factory.cc b/exporters/prometheus/src/exporter_factory.cc index 93fca80977..f736dc755d 100644 --- a/exporters/prometheus/src/exporter_factory.cc +++ b/exporters/prometheus/src/exporter_factory.cc @@ -1,11 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include +#include #include "opentelemetry/exporters/prometheus/exporter.h" #include "opentelemetry/exporters/prometheus/exporter_factory.h" #include "opentelemetry/exporters/prometheus/exporter_options.h" +#include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/prometheus/src/exporter_utils.cc b/exporters/prometheus/src/exporter_utils.cc index 598c88cb44..c874faa654 100644 --- a/exporters/prometheus/src/exporter_utils.cc +++ b/exporters/prometheus/src/exporter_utils.cc @@ -1,24 +1,36 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include #include +#include +#include +#include +#include #include +#include #include #include #include +#include #include -#include #include #include -#include "prometheus/metric_family.h" -#include "prometheus/metric_type.h" - -#include "opentelemetry/common/macros.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/prometheus/exporter_utils.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" namespace prometheus_client = ::prometheus; namespace metric_sdk = opentelemetry::sdk::metrics; diff --git a/exporters/prometheus/test/collector_test.cc b/exporters/prometheus/test/collector_test.cc index a31d23ab72..f0626c8a0b 100644 --- a/exporters/prometheus/test/collector_test.cc +++ b/exporters/prometheus/test/collector_test.cc @@ -1,16 +1,20 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + #include "opentelemetry/exporters/prometheus/collector.h" #include "opentelemetry/metrics/meter_provider.h" -#include "opentelemetry/version.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/metric_reader.h" #include "prometheus_test_helper.h" -#include -#include -#include -#include - using opentelemetry::exporter::metrics::PrometheusCollector; using opentelemetry::sdk::metrics::MetricProducer; using opentelemetry::sdk::metrics::ResourceMetrics; diff --git a/exporters/prometheus/test/exporter_test.cc b/exporters/prometheus/test/exporter_test.cc index b268ac8514..aa2e0de4bf 100644 --- a/exporters/prometheus/test/exporter_test.cc +++ b/exporters/prometheus/test/exporter_test.cc @@ -2,12 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include -#include "opentelemetry/exporters/prometheus/collector.h" #include "opentelemetry/exporters/prometheus/exporter.h" +#include "opentelemetry/exporters/prometheus/exporter_options.h" #include "opentelemetry/sdk/metrics/instruments.h" -#include "opentelemetry/version.h" -#include "prometheus_test_helper.h" /** * PrometheusExporterTest is a friend class of PrometheusExporter. diff --git a/exporters/prometheus/test/exporter_utils_test.cc b/exporters/prometheus/test/exporter_utils_test.cc index 76ec869a6f..5a597f2b29 100644 --- a/exporters/prometheus/test/exporter_utils_test.cc +++ b/exporters/prometheus/test/exporter_utils_test.cc @@ -2,13 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 #include - +#include +#include +#include +#include +#include +#include +#include #include -#include "prometheus/metric_family.h" -#include "prometheus/metric_type.h" +#include +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/prometheus/exporter_utils.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" #include "prometheus_test_helper.h" using opentelemetry::exporter::metrics::PrometheusExporterUtils; diff --git a/exporters/prometheus/test/prometheus_test_helper.h b/exporters/prometheus/test/prometheus_test_helper.h index b1aaf70d8c..1bf1f17657 100644 --- a/exporters/prometheus/test/prometheus_test_helper.h +++ b/exporters/prometheus/test/prometheus_test_helper.h @@ -3,6 +3,8 @@ #pragma once +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" namespace metric_sdk = opentelemetry::sdk::metrics; diff --git a/opentracing-shim/include/opentelemetry/opentracingshim/propagation.h b/opentracing-shim/include/opentelemetry/opentracingshim/propagation.h index 4e44276a3d..3eceedb35f 100644 --- a/opentracing-shim/include/opentelemetry/opentracingshim/propagation.h +++ b/opentracing-shim/include/opentelemetry/opentracingshim/propagation.h @@ -5,13 +5,14 @@ #pragma once +#include "opentracing/propagation.h" +#include "opentracing/value.h" + #include "opentelemetry/baggage/baggage.h" #include "opentelemetry/common/attribute_value.h" #include "opentelemetry/context/propagation/text_map_propagator.h" #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/nostd/string_view.h" -#include "opentracing/propagation.h" -#include "opentracing/value.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h b/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h index 3436473870..f072168702 100644 --- a/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h +++ b/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h @@ -5,11 +5,34 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include + +#include "opentracing/propagation.h" +#include "opentracing/span.h" +#include "opentracing/string_view.h" +#include "opentracing/tracer.h" +#include "opentracing/value.h" +#include "opentracing/variant/recursive_wrapper.hpp" + +#include "opentelemetry/baggage/baggage.h" +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/opentracingshim/span_context_shim.h" - #include "opentelemetry/semconv/incubating/opentracing_attributes.h" -#include "opentelemetry/trace/tracer.h" -#include "opentracing/tracer.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_context_kv_iterable.h" +#include "opentelemetry/trace/span_startoptions.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/include/opentelemetry/opentracingshim/span_context_shim.h b/opentracing-shim/include/opentelemetry/opentracingshim/span_context_shim.h index 55cdd5d86d..8eba4a6377 100644 --- a/opentracing-shim/include/opentelemetry/opentracingshim/span_context_shim.h +++ b/opentracing-shim/include/opentelemetry/opentracingshim/span_context_shim.h @@ -5,9 +5,16 @@ #pragma once +#include +#include + +#include "opentracing/span.h" + #include "opentelemetry/baggage/baggage.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/trace/span_context.h" -#include "opentracing/span.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/include/opentelemetry/opentracingshim/span_shim.h b/opentracing-shim/include/opentelemetry/opentracingshim/span_shim.h index 4fe48852c1..f15a07f2dc 100644 --- a/opentracing-shim/include/opentelemetry/opentracingshim/span_shim.h +++ b/opentracing-shim/include/opentelemetry/opentracingshim/span_shim.h @@ -5,14 +5,24 @@ #pragma once -#include "opentelemetry/opentracingshim/span_context_shim.h" -#include "opentelemetry/opentracingshim/tracer_shim.h" +#include +#include +#include +#include + +#include "opentracing/span.h" +#include "opentracing/string_view.h" +#include "opentracing/tracer.h" +#include "opentracing/util.h" +#include "opentracing/value.h" -#include "opentelemetry/baggage/baggage.h" -#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/opentracingshim/span_context_shim.h" +#include "opentelemetry/opentracingshim/tracer_shim.h" #include "opentelemetry/trace/span.h" -#include "opentracing/span.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/include/opentelemetry/opentracingshim/tracer_shim.h b/opentracing-shim/include/opentelemetry/opentracingshim/tracer_shim.h index 7f2d492efd..fcce5a6341 100644 --- a/opentracing-shim/include/opentelemetry/opentracingshim/tracer_shim.h +++ b/opentracing-shim/include/opentelemetry/opentracingshim/tracer_shim.h @@ -5,10 +5,21 @@ #pragma once +#include +#include + +#include "opentracing/expected/expected.hpp" +#include "opentracing/propagation.h" +#include "opentracing/span.h" +#include "opentracing/string_view.h" +#include "opentracing/tracer.h" + #include "opentelemetry/context/propagation/text_map_propagator.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/tracer.h" -#include "opentracing/tracer.h" +#include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/src/shim_utils.cc b/opentracing-shim/src/shim_utils.cc index 6cfb9a5328..e3f6fc72cf 100644 --- a/opentracing-shim/src/shim_utils.cc +++ b/opentracing-shim/src/shim_utils.cc @@ -3,9 +3,28 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "opentelemetry/opentracingshim/shim_utils.h" +#include +#include +#include +#include +#include +#include + +#include "opentracing/propagation.h" +#include "opentracing/span.h" +#include "opentracing/tracer.h" +#include "opentelemetry/baggage/baggage.h" #include "opentelemetry/baggage/baggage_context.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/opentracingshim/shim_utils.h" +#include "opentelemetry/opentracingshim/span_context_shim.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_startoptions.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/src/span_context_shim.cc b/opentracing-shim/src/span_context_shim.cc index cd1069e9d9..153d40154e 100644 --- a/opentracing-shim/src/span_context_shim.cc +++ b/opentracing-shim/src/span_context_shim.cc @@ -3,7 +3,21 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include +#include + +#include "opentracing/span.h" + +#include "opentelemetry/baggage/baggage.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/opentracingshim/span_context_shim.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/src/span_shim.cc b/opentracing-shim/src/span_shim.cc index afc974f057..6bbac7ee80 100644 --- a/opentracing-shim/src/span_shim.cc +++ b/opentracing-shim/src/span_shim.cc @@ -3,14 +3,32 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "opentelemetry/opentracingshim/span_shim.h" +#include +#include +#include +#include +#include +#include +#include + +#include "opentracing/ext/tags.h" +#include "opentracing/span.h" +#include "opentracing/string_view.h" +#include "opentracing/util.h" +#include "opentracing/value.h" + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/opentracingshim/shim_utils.h" #include "opentelemetry/opentracingshim/span_context_shim.h" -#include "opentelemetry/opentracingshim/tracer_shim.h" - +#include "opentelemetry/opentracingshim/span_shim.h" #include "opentelemetry/semconv/exception_attributes.h" +#include "opentelemetry/trace/span.h" #include "opentelemetry/trace/span_metadata.h" -#include "opentracing/ext/tags.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/src/tracer_shim.cc b/opentracing-shim/src/tracer_shim.cc index e06961a88e..8c1ae8328a 100644 --- a/opentracing-shim/src/tracer_shim.cc +++ b/opentracing-shim/src/tracer_shim.cc @@ -3,15 +3,39 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "opentelemetry/opentracingshim/tracer_shim.h" -#include "opentelemetry/opentracingshim/propagation.h" -#include "opentelemetry/opentracingshim/shim_utils.h" -#include "opentelemetry/opentracingshim/span_shim.h" +#include +#include +#include +#include +#include +#include +#include + +#include "opentracing/expected/expected.hpp" +#include "opentracing/ext/tags.h" +#include "opentracing/propagation.h" +#include "opentracing/span.h" +#include "opentracing/string_view.h" +#include "opentracing/tracer.h" +#include "opentracing/value.h" #include "opentelemetry/baggage/baggage_context.h" #include "opentelemetry/context/propagation/global_propagator.h" +#include "opentelemetry/context/propagation/text_map_propagator.h" +#include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/opentracingshim/propagation.h" +#include "opentelemetry/opentracingshim/shim_utils.h" +#include "opentelemetry/opentracingshim/span_context_shim.h" +#include "opentelemetry/opentracingshim/span_shim.h" +#include "opentelemetry/opentracingshim/tracer_shim.h" #include "opentelemetry/trace/context.h" -#include "opentracing/ext/tags.h" +#include "opentelemetry/trace/default_span.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace opentracingshim diff --git a/opentracing-shim/test/propagation_test.cc b/opentracing-shim/test/propagation_test.cc index eb59630405..497f0eb0ae 100644 --- a/opentracing-shim/test/propagation_test.cc +++ b/opentracing-shim/test/propagation_test.cc @@ -3,11 +3,25 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "shim_mocks.h" - +#include +#include +#include +#include +#include +#include + +#include "opentracing/expected/expected.hpp" +#include "opentracing/propagation.h" +#include "opentracing/string_view.h" +#include "opentracing/util.h" + +#include "opentelemetry/baggage/baggage.h" +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/opentracingshim/propagation.h" -#include +#include "shim_mocks.h" namespace baggage = opentelemetry::baggage; namespace common = opentelemetry::common; diff --git a/opentracing-shim/test/shim_mocks.h b/opentracing-shim/test/shim_mocks.h index b39b2b3781..485e166233 100644 --- a/opentracing-shim/test/shim_mocks.h +++ b/opentracing-shim/test/shim_mocks.h @@ -5,6 +5,11 @@ #pragma once +#include +#include + +#include "opentracing/propagation.h" + #include "opentelemetry/baggage/baggage_context.h" #include "opentelemetry/context/propagation/text_map_propagator.h" #include "opentelemetry/trace/span.h" @@ -12,10 +17,6 @@ #include "opentelemetry/trace/span_metadata.h" #include "opentelemetry/trace/tracer.h" #include "opentelemetry/trace/tracer_provider.h" -#include "opentracing/propagation.h" - -#include -#include namespace trace_api = opentelemetry::trace; namespace baggage = opentelemetry::baggage; diff --git a/opentracing-shim/test/shim_utils_test.cc b/opentracing-shim/test/shim_utils_test.cc index d053273984..6af28d60cb 100644 --- a/opentracing-shim/test/shim_utils_test.cc +++ b/opentracing-shim/test/shim_utils_test.cc @@ -3,13 +3,40 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "shim_mocks.h" - -#include "opentelemetry/opentracingshim/shim_utils.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentracing/propagation.h" +#include "opentracing/span.h" +#include "opentracing/string_view.h" #include "opentracing/tracer.h" +#include "opentracing/util.h" +#include "opentracing/value.h" +#include "opentracing/variant/recursive_wrapper.hpp" + +#include "opentelemetry/baggage/baggage.h" +#include "opentelemetry/baggage/baggage_context.h" +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/opentracingshim/shim_utils.h" +#include "opentelemetry/opentracingshim/span_context_shim.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_startoptions.h" -#include +#include "shim_mocks.h" namespace trace_api = opentelemetry::trace; namespace baggage = opentelemetry::baggage; diff --git a/opentracing-shim/test/span_context_shim_test.cc b/opentracing-shim/test/span_context_shim_test.cc index 93978f079a..9433f3a1cb 100644 --- a/opentracing-shim/test/span_context_shim_test.cc +++ b/opentracing-shim/test/span_context_shim_test.cc @@ -3,14 +3,23 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "opentelemetry/opentracingshim/span_context_shim.h" - -#include "opentelemetry/baggage/baggage.h" -#include "opentelemetry/trace/span_context.h" +#include +#include +#include +#include +#include +#include #include "opentracing/noop.h" +#include "opentracing/span.h" +#include "opentracing/tracer.h" +#include "opentracing/value.h" -#include +#include "opentelemetry/baggage/baggage.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/opentracingshim/span_context_shim.h" +#include "opentelemetry/trace/span_context.h" namespace trace_api = opentelemetry::trace; namespace baggage = opentelemetry::baggage; diff --git a/opentracing-shim/test/span_shim_test.cc b/opentracing-shim/test/span_shim_test.cc index d73f3e0061..0b1aaf80c3 100644 --- a/opentracing-shim/test/span_shim_test.cc +++ b/opentracing-shim/test/span_shim_test.cc @@ -3,12 +3,37 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "shim_mocks.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentracing/span.h" +#include "opentracing/string_view.h" +#include "opentracing/util.h" +#include "opentracing/value.h" + +#include "opentelemetry/baggage/baggage.h" +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/opentracingshim/span_shim.h" #include "opentelemetry/opentracingshim/tracer_shim.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_metadata.h" -#include +#include "shim_mocks.h" namespace trace_api = opentelemetry::trace; namespace baggage = opentelemetry::baggage; diff --git a/opentracing-shim/test/tracer_shim_test.cc b/opentracing-shim/test/tracer_shim_test.cc index 2d3f2618da..7e48f47d0c 100644 --- a/opentracing-shim/test/tracer_shim_test.cc +++ b/opentracing-shim/test/tracer_shim_test.cc @@ -3,16 +3,46 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "shim_mocks.h" - +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentracing/expected/expected.hpp" +#include "opentracing/noop.h" +#include "opentracing/propagation.h" +#include "opentracing/span.h" +#include "opentracing/tracer.h" +#include "opentracing/util.h" +#include "opentracing/value.h" + +#include "opentelemetry/baggage/baggage.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/context/propagation/text_map_propagator.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/opentracingshim/shim_utils.h" #include "opentelemetry/opentracingshim/span_context_shim.h" -#include "opentelemetry/opentracingshim/span_shim.h" #include "opentelemetry/opentracingshim/tracer_shim.h" +#include "opentelemetry/trace/default_span.h" +#include "opentelemetry/trace/provider.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_flags.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/trace/tracer_provider.h" -#include "opentracing/noop.h" - -#include +#include "shim_mocks.h" namespace trace_api = opentelemetry::trace; namespace nostd = opentelemetry::nostd; diff --git a/sdk/src/logs/batch_log_record_processor.cc b/sdk/src/logs/batch_log_record_processor.cc index e2a4c12463..2080136303 100644 --- a/sdk/src/logs/batch_log_record_processor.cc +++ b/sdk/src/logs/batch_log_record_processor.cc @@ -19,7 +19,6 @@ #include "opentelemetry/sdk/common/atomic_unique_ptr.h" #include "opentelemetry/sdk/common/circular_buffer.h" #include "opentelemetry/sdk/common/circular_buffer_range.h" -#include "opentelemetry/sdk/common/thread_instrumentation.h" #include "opentelemetry/sdk/logs/batch_log_record_processor.h" #include "opentelemetry/sdk/logs/batch_log_record_processor_options.h" #include "opentelemetry/sdk/logs/batch_log_record_processor_runtime_options.h" diff --git a/sdk/src/metrics/export/periodic_exporting_metric_reader.cc b/sdk/src/metrics/export/periodic_exporting_metric_reader.cc index 1e4916e4db..f9970312e4 100644 --- a/sdk/src/metrics/export/periodic_exporting_metric_reader.cc +++ b/sdk/src/metrics/export/periodic_exporting_metric_reader.cc @@ -16,7 +16,6 @@ #include "opentelemetry/common/timestamp.h" #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk/common/thread_instrumentation.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" diff --git a/sdk/src/trace/batch_span_processor.cc b/sdk/src/trace/batch_span_processor.cc index 595068529a..9a16724e4d 100644 --- a/sdk/src/trace/batch_span_processor.cc +++ b/sdk/src/trace/batch_span_processor.cc @@ -20,7 +20,6 @@ #include "opentelemetry/sdk/common/circular_buffer.h" #include "opentelemetry/sdk/common/circular_buffer_range.h" #include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk/common/thread_instrumentation.h" #include "opentelemetry/sdk/trace/batch_span_processor.h" #include "opentelemetry/sdk/trace/batch_span_processor_options.h" #include "opentelemetry/sdk/trace/batch_span_processor_runtime_options.h"