From 0dd64e07478b7f6b86f24d469b60941c5bf5ce4c Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 29 May 2024 19:06:10 +0200 Subject: [PATCH] [CI] include-what-you-use (#2629) --- .github/workflows/iwyu.yml | 60 +++++++++++++++++++ .iwyu.imp | 13 ++++ api/include/opentelemetry/version.h | 2 +- sdk/include/opentelemetry/sdk/common/base64.h | 1 - .../sdk/common/global_log_handler.h | 3 +- .../sdk/metrics/async_instruments.h | 6 +- .../sdk/metrics/meter_provider.h | 23 +++---- .../sdk/metrics/meter_provider_factory.h | 7 +-- .../sdk/trace/batch_span_processor.h | 8 ++- .../sdk/trace/batch_span_processor_factory.h | 6 +- .../opentelemetry/sdk/trace/exporter.h | 2 +- .../sdk/trace/random_id_generator.h | 2 + .../sdk/trace/random_id_generator_factory.h | 2 +- .../sdk/trace/samplers/always_off_factory.h | 2 +- .../sdk/trace/samplers/always_on_factory.h | 2 +- .../opentelemetry/sdk/trace/samplers/parent.h | 18 ++---- .../sdk/trace/samplers/parent_factory.h | 2 +- .../sdk/trace/samplers/trace_id_ratio.h | 13 +--- .../trace/samplers/trace_id_ratio_factory.h | 2 +- .../sdk/trace/simple_processor_factory.h | 4 +- sdk/include/opentelemetry/sdk/trace/tracer.h | 19 +++--- .../opentelemetry/sdk/trace/tracer_context.h | 2 + .../sdk/trace/tracer_context_factory.h | 14 ++--- .../opentelemetry/sdk/trace/tracer_provider.h | 12 ++-- .../sdk/trace/tracer_provider_factory.h | 20 ++----- sdk/src/common/BUILD | 1 - sdk/src/common/CMakeLists.txt | 3 +- sdk/src/common/base64.cc | 1 - sdk/src/common/core.cc | 8 --- sdk/src/common/env_variables.cc | 4 +- sdk/src/common/platform/fork_unix.cc | 1 + sdk/src/common/random.h | 2 + sdk/src/metrics/async_instruments.cc | 4 +- sdk/src/metrics/meter_provider.cc | 14 +++-- sdk/src/metrics/meter_provider_factory.cc | 11 +--- sdk/src/resource/resource.cc | 6 +- sdk/src/resource/resource_detector.cc | 3 + sdk/src/trace/batch_span_processor.cc | 23 ++++++- sdk/src/trace/batch_span_processor_factory.cc | 8 ++- sdk/src/trace/random_id_generator.cc | 5 ++ sdk/src/trace/samplers/always_off_factory.cc | 3 +- sdk/src/trace/samplers/always_on_factory.cc | 3 +- sdk/src/trace/samplers/parent.cc | 11 ++++ sdk/src/trace/samplers/parent_factory.cc | 3 +- sdk/src/trace/samplers/trace_id_ratio.cc | 15 ++++- .../trace/samplers/trace_id_ratio_factory.cc | 4 +- sdk/src/trace/simple_processor_factory.cc | 8 ++- sdk/src/trace/span.cc | 9 +-- sdk/src/trace/span.h | 11 ++++ sdk/src/trace/tracer.cc | 27 ++++++++- sdk/src/trace/tracer_context.cc | 12 +++- sdk/src/trace/tracer_context_factory.cc | 12 +++- sdk/src/trace/tracer_provider.cc | 21 ++++++- sdk/src/trace/tracer_provider_factory.cc | 12 +++- 54 files changed, 333 insertions(+), 157 deletions(-) create mode 100644 .github/workflows/iwyu.yml create mode 100644 .iwyu.imp delete mode 100644 sdk/src/common/core.cc diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml new file mode 100644 index 0000000000..de60502794 --- /dev/null +++ b/.github/workflows/iwyu.yml @@ -0,0 +1,60 @@ + +name: include-what-you-use + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + iwyu: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: setup dependencies + run: | + sudo apt update -y + sudo apt install -y --no-install-recommends --no-install-suggests \ + build-essential \ + iwyu \ + cmake \ + ninja-build \ + libssl-dev \ + libcurl4-openssl-dev \ + libprotobuf-dev \ + protobuf-compiler \ + libgmock-dev \ + libgtest-dev \ + libbenchmark-dev + + - name: Prepare CMake + run: | + TOPDIR=`pwd` + mkdir build && cd build + CC="clang" CXX="clang++" cmake \ + -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \ + -DBUILD_TESTING=OFF \ + -DBUILD_W3CTRACECONTEXT_TEST=OFF \ + .. + + - name: iwyu_tool + run: | + cd build + make -k 2>&1 | tee -a iwyu.log + + - uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: Logs (include-what-you-use) + path: ./build/*.log + + - name: count warnings + run: | + cd build + COUNT=`grep -c "Warning:" iwyu.log` + echo "include-what-you-use reported ${COUNT} warning(s)" + diff --git a/.iwyu.imp b/.iwyu.imp new file mode 100644 index 0000000000..53fddd24aa --- /dev/null +++ b/.iwyu.imp @@ -0,0 +1,13 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +# include-what-you-use mapping file + +[ + # Work around for C++ STL + { "include": ["", "private", "", "public"] }, + + # Local opentelemetry-cpp + +] + diff --git a/api/include/opentelemetry/version.h b/api/include/opentelemetry/version.h index 31f6e35acb..6e8a24a2d4 100644 --- a/api/include/opentelemetry/version.h +++ b/api/include/opentelemetry/version.h @@ -3,7 +3,7 @@ #pragma once -#include "opentelemetry/common/macros.h" +#include "opentelemetry/common/macros.h" // IWYU pragma: export #include "opentelemetry/detail/preprocessor.h" #ifndef OPENTELEMETRY_ABI_VERSION_NO diff --git a/sdk/include/opentelemetry/sdk/common/base64.h b/sdk/include/opentelemetry/sdk/common/base64.h index d88204675c..918eaaf14a 100644 --- a/sdk/include/opentelemetry/sdk/common/base64.h +++ b/sdk/include/opentelemetry/sdk/common/base64.h @@ -5,7 +5,6 @@ #include -#include "opentelemetry/common/macros.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/common/global_log_handler.h b/sdk/include/opentelemetry/sdk/common/global_log_handler.h index 10bf42a145..59a08e08a6 100644 --- a/sdk/include/opentelemetry/sdk/common/global_log_handler.h +++ b/sdk/include/opentelemetry/sdk/common/global_log_handler.h @@ -3,7 +3,8 @@ #pragma once -#include +#include // IWYU pragma: keep +#include #include #include "opentelemetry/nostd/shared_ptr.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/async_instruments.h b/sdk/include/opentelemetry/sdk/metrics/async_instruments.h index 48c7d14ec5..2ff8c9702e 100644 --- a/sdk/include/opentelemetry/sdk/metrics/async_instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/async_instruments.h @@ -6,8 +6,9 @@ #include #include "opentelemetry/metrics/async_instruments.h" -#include "opentelemetry/metrics/observer_result.h" #include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/state/metric_storage.h" +#include "opentelemetry/sdk/metrics/state/observable_registry.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -16,9 +17,6 @@ namespace sdk namespace metrics { -class AsyncWritableMetricStorage; -class ObservableRegistry; - class ObservableInstrument : public opentelemetry::metrics::ObservableInstrument { public: diff --git a/sdk/include/opentelemetry/sdk/metrics/meter_provider.h b/sdk/include/opentelemetry/sdk/metrics/meter_provider.h index ddeb6d96ac..a838f2a96a 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter_provider.h +++ b/sdk/include/opentelemetry/sdk/metrics/meter_provider.h @@ -7,34 +7,29 @@ #include #include +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/metrics/meter_provider.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/metric_reader.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" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW # include "opentelemetry/sdk/metrics/exemplar/filter_type.h" #endif -#include "opentelemetry/sdk/metrics/view/view_registry.h" -#include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/version.h" - OPENTELEMETRY_BEGIN_NAMESPACE -namespace metrics -{ -class Meter; -} // namespace metrics - namespace sdk { namespace metrics { -// forward declaration -class MeterContext; -class MetricCollector; -class MetricReader; - class OPENTELEMETRY_EXPORT MeterProvider final : public opentelemetry::metrics::MeterProvider { public: diff --git a/sdk/include/opentelemetry/sdk/metrics/meter_provider_factory.h b/sdk/include/opentelemetry/sdk/metrics/meter_provider_factory.h index 69e77ebf5e..15aa13badc 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter_provider_factory.h +++ b/sdk/include/opentelemetry/sdk/metrics/meter_provider_factory.h @@ -4,13 +4,10 @@ #pragma once #include -#include -#include -#include "opentelemetry/metrics/meter.h" + #include "opentelemetry/metrics/meter_provider.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/metrics/meter.h" #include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/view/view_registry.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h b/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h index e23b0a2df2..e069a461e6 100644 --- a/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h +++ b/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h @@ -3,7 +3,9 @@ #pragma once +#include #include +#include #include #include #include @@ -11,7 +13,11 @@ #include #include "opentelemetry/sdk/common/circular_buffer.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/trace/span_context.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -19,8 +25,6 @@ namespace sdk { namespace trace { -class SpanExporter; -struct BatchSpanProcessorOptions; /** * This is an implementation of the SpanProcessor which creates batches of finished spans and passes diff --git a/sdk/include/opentelemetry/sdk/trace/batch_span_processor_factory.h b/sdk/include/opentelemetry/sdk/trace/batch_span_processor_factory.h index 4f645b2633..bfec277b1d 100644 --- a/sdk/include/opentelemetry/sdk/trace/batch_span_processor_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/batch_span_processor_factory.h @@ -5,6 +5,9 @@ #include +#include "opentelemetry/sdk/trace/batch_span_processor_options.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,9 +15,6 @@ namespace sdk { namespace trace { -class SpanExporter; -class SpanProcessor; -struct BatchSpanProcessorOptions; /** * Factory class for BatchSpanProcessor. diff --git a/sdk/include/opentelemetry/sdk/trace/exporter.h b/sdk/include/opentelemetry/sdk/trace/exporter.h index 8795b69837..8f207e89f2 100644 --- a/sdk/include/opentelemetry/sdk/trace/exporter.h +++ b/sdk/include/opentelemetry/sdk/trace/exporter.h @@ -8,6 +8,7 @@ #include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -15,7 +16,6 @@ namespace sdk { namespace trace { -class Recordable; /** * SpanExporter defines the interface that protocol-specific span exporters must diff --git a/sdk/include/opentelemetry/sdk/trace/random_id_generator.h b/sdk/include/opentelemetry/sdk/trace/random_id_generator.h index a2adcf55f7..01e460563d 100644 --- a/sdk/include/opentelemetry/sdk/trace/random_id_generator.h +++ b/sdk/include/opentelemetry/sdk/trace/random_id_generator.h @@ -4,6 +4,8 @@ #pragma once #include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_id.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/trace/random_id_generator_factory.h b/sdk/include/opentelemetry/sdk/trace/random_id_generator_factory.h index 6c94984403..a1915d3136 100644 --- a/sdk/include/opentelemetry/sdk/trace/random_id_generator_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/random_id_generator_factory.h @@ -5,6 +5,7 @@ #include +#include "opentelemetry/sdk/trace/id_generator.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,7 +13,6 @@ namespace sdk { namespace trace { -class IdGenerator; /** * Factory class for RandomIdGenerator. diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/always_off_factory.h b/sdk/include/opentelemetry/sdk/trace/samplers/always_off_factory.h index 19f76c715f..af676dead9 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/always_off_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/always_off_factory.h @@ -5,6 +5,7 @@ #include +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,7 +13,6 @@ namespace sdk { namespace trace { -class Sampler; /** * Factory class for AlwaysOffSampler. diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/always_on_factory.h b/sdk/include/opentelemetry/sdk/trace/samplers/always_on_factory.h index c72d97fdec..80b38f8456 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/always_on_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/always_on_factory.h @@ -5,6 +5,7 @@ #include +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,7 +13,6 @@ namespace sdk { namespace trace { -class Sampler; /** * Factory class for AlwaysOnSampler. diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/parent.h b/sdk/include/opentelemetry/sdk/trace/samplers/parent.h index 59dd314589..d5054d9218 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/parent.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/parent.h @@ -4,28 +4,22 @@ #pragma once #include +#include +#include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace common -{ -class KeyValueIterable; -} // namespace common - -namespace trace -{ -class SpanContext; -class SpanContextKeyValueIterable; -class TraceState; -} // namespace trace - namespace sdk { namespace trace { + /** * The ParentBased sampler is a composite sampler. ParentBased(delegateSampler) either respects * the parent span's sampling decision or delegates to delegateSampler for root spans. diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h b/sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h index 2fdf87819d..68557ace79 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h @@ -5,6 +5,7 @@ #include +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,7 +13,6 @@ namespace sdk { namespace trace { -class Sampler; /** * Factory class for ParentBasedSampler. diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio.h b/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio.h index b5df576091..f1b895139f 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio.h @@ -3,6 +3,7 @@ #pragma once +#include #include #include "opentelemetry/nostd/string_view.h" @@ -12,18 +13,6 @@ #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace common -{ -class KeyValueIterable; -} // namespace common - -namespace trace -{ -class SpanContext; -class SpanContextKeyValueIterable; -class TraceState; -} // namespace trace - namespace sdk { namespace trace diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h b/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h index eb434fc6fe..de6d98906b 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h @@ -5,6 +5,7 @@ #include +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,7 +13,6 @@ namespace sdk { namespace trace { -class Sampler; /** * Factory class for TraceIdRatioBasedSampler. diff --git a/sdk/include/opentelemetry/sdk/trace/simple_processor_factory.h b/sdk/include/opentelemetry/sdk/trace/simple_processor_factory.h index 6a106e7f21..2ae40c2f7b 100644 --- a/sdk/include/opentelemetry/sdk/trace/simple_processor_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/simple_processor_factory.h @@ -5,6 +5,8 @@ #include +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,8 +14,6 @@ namespace sdk { namespace trace { -class SpanExporter; -class SpanProcessor; /** * Factory class for SimpleSpanProcessor. diff --git a/sdk/include/opentelemetry/sdk/trace/tracer.h b/sdk/include/opentelemetry/sdk/trace/tracer.h index 67e606ba97..778ffe8173 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer.h @@ -3,29 +3,30 @@ #pragma once +#include #include -#include "opentelemetry/common/macros.h" +#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/trace/samplers/always_on.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/tracer_context.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context_kv_iterable.h" +#include "opentelemetry/trace/span_startoptions.h" #include "opentelemetry/trace/tracer.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { -namespace resource -{ -class Resource; -} // namespace resource - namespace trace { -class IdGenerator; -class SpanProcessor; using namespace opentelemetry::sdk::instrumentationscope; diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_context.h b/sdk/include/opentelemetry/sdk/trace/tracer_context.h index 9475c8c0b9..73bbe4f84b 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_context.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_context.h @@ -8,8 +8,10 @@ #include #include "opentelemetry/sdk/resource/resource.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/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_context_factory.h b/sdk/include/opentelemetry/sdk/trace/tracer_context_factory.h index 1911db8f93..4954fd7c3f 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_context_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_context_factory.h @@ -6,22 +6,18 @@ #include #include +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { -namespace resource -{ -class Resource; -} // namespace resource - namespace trace { -class IdGenerator; -class Sampler; -class SpanProcessor; -class TracerContext; /** * Factory class for TracerContext. diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_provider.h b/sdk/include/opentelemetry/sdk/trace/tracer_provider.h index ce2a6d4401..e0f3ce0c4c 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_provider.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_provider.h @@ -3,17 +3,22 @@ #pragma once -#include +#include #include #include -#include #include #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/resource/resource.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/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" +#include "opentelemetry/sdk/trace/tracer.h" +#include "opentelemetry/sdk/trace/tracer_context.h" +#include "opentelemetry/trace/tracer.h" #include "opentelemetry/trace/tracer_provider.h" #include "opentelemetry/version.h" @@ -22,9 +27,6 @@ namespace sdk { namespace trace { -class SpanProcessor; -class Tracer; -class TracerContext; class TracerProvider final : public opentelemetry::trace::TracerProvider { diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_provider_factory.h b/sdk/include/opentelemetry/sdk/trace/tracer_provider_factory.h index e9dfa82edb..17f7ea395a 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_provider_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_provider_factory.h @@ -6,27 +6,19 @@ #include #include +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/sdk/trace/tracer_context.h" +#include "opentelemetry/trace/tracer_provider.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace trace -{ -class TracerProvider; -} // namespace trace - namespace sdk { -namespace resource -{ -class Resource; -} // namespace resource - namespace trace { -class IdGenerator; -class Sampler; -class SpanProcessor; -class TracerContext; /** * Factory class for TracerProvider. diff --git a/sdk/src/common/BUILD b/sdk/src/common/BUILD index fe75f08d7c..9c424cac6b 100644 --- a/sdk/src/common/BUILD +++ b/sdk/src/common/BUILD @@ -6,7 +6,6 @@ package(default_visibility = ["//visibility:public"]) cc_library( name = "random", srcs = [ - "core.cc", "random.cc", ], hdrs = [ diff --git a/sdk/src/common/CMakeLists.txt b/sdk/src/common/CMakeLists.txt index 9f0e61f1e2..664db38e17 100644 --- a/sdk/src/common/CMakeLists.txt +++ b/sdk/src/common/CMakeLists.txt @@ -1,8 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -set(COMMON_SRCS random.cc core.cc global_log_handler.cc env_variables.cc - base64.cc) +set(COMMON_SRCS random.cc global_log_handler.cc env_variables.cc base64.cc) if(WIN32) list(APPEND COMMON_SRCS platform/fork_windows.cc) else() diff --git a/sdk/src/common/base64.cc b/sdk/src/common/base64.cc index a19af1f8a3..3c572fe344 100644 --- a/sdk/src/common/base64.cc +++ b/sdk/src/common/base64.cc @@ -9,7 +9,6 @@ # include #endif #include -#include #include #if defined(HAVE_ABSEIL) diff --git a/sdk/src/common/core.cc b/sdk/src/common/core.cc deleted file mode 100644 index 16012e765c..0000000000 --- a/sdk/src/common/core.cc +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// clang-format off -// version.h should be included before nostd/variant.h. -#include "opentelemetry/version.h" -#include "opentelemetry/nostd/variant.h" -// clang-format on diff --git a/sdk/src/common/env_variables.cc b/sdk/src/common/env_variables.cc index a3f50b15ba..586a8ed420 100644 --- a/sdk/src/common/env_variables.cc +++ b/sdk/src/common/env_variables.cc @@ -10,8 +10,10 @@ # include #endif -#include +#include +#include +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/version.h" diff --git a/sdk/src/common/platform/fork_unix.cc b/sdk/src/common/platform/fork_unix.cc index cfbd8ab778..41926bbfe7 100644 --- a/sdk/src/common/platform/fork_unix.cc +++ b/sdk/src/common/platform/fork_unix.cc @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include "opentelemetry/version.h" #include "src/common/platform/fork.h" #include diff --git a/sdk/src/common/random.h b/sdk/src/common/random.h index ecd6dabc1e..28adbaf41c 100644 --- a/sdk/src/common/random.h +++ b/sdk/src/common/random.h @@ -3,6 +3,8 @@ #pragma once +#include + #include "opentelemetry/nostd/span.h" #include "opentelemetry/version.h" #include "src/common/fast_random_number_generator.h" diff --git a/sdk/src/metrics/async_instruments.cc b/sdk/src/metrics/async_instruments.cc index 5ca56b3969..88f818dad9 100644 --- a/sdk/src/metrics/async_instruments.cc +++ b/sdk/src/metrics/async_instruments.cc @@ -1,10 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include + #include "opentelemetry/sdk/metrics/async_instruments.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" #include "opentelemetry/sdk/metrics/state/observable_registry.h" -#include "opentelemetry/sdk_config.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/meter_provider.cc b/sdk/src/metrics/meter_provider.cc index 943ae137bd..84a0f56bf4 100644 --- a/sdk/src/metrics/meter_provider.cc +++ b/sdk/src/metrics/meter_provider.cc @@ -1,18 +1,20 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/meter_provider.h" +#include +#include + +#include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/metrics/meter.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/metrics/meter.h" #include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/sdk/metrics/metric_reader.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk_config.h" #include "opentelemetry/version.h" -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/src/metrics/meter_provider_factory.cc b/sdk/src/metrics/meter_provider_factory.cc index bd6bbe932c..43c060e5f9 100644 --- a/sdk/src/metrics/meter_provider_factory.cc +++ b/sdk/src/metrics/meter_provider_factory.cc @@ -1,20 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/meter_provider_factory.h" +#include + #include "opentelemetry/metrics/meter.h" #include "opentelemetry/sdk/metrics/meter_provider.h" -#include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/metrics/meter_provider_factory.h" #include "opentelemetry/sdk/metrics/view/view_registry_factory.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk_config.h" #include "opentelemetry/version.h" -#include - namespace resource = opentelemetry::sdk::resource; -namespace metrics_api = opentelemetry::metrics; namespace metrics_sdk = opentelemetry::sdk::metrics; OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/resource/resource.cc b/sdk/src/resource/resource.cc index 12f8e16d43..919624686d 100644 --- a/sdk/src/resource/resource.cc +++ b/sdk/src/resource/resource.cc @@ -1,8 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" #include "opentelemetry/sdk/version/version.h" diff --git a/sdk/src/resource/resource_detector.cc b/sdk/src/resource/resource_detector.cc index 2f560e1150..b7c7c7e614 100644 --- a/sdk/src/resource/resource_detector.cc +++ b/sdk/src/resource/resource_detector.cc @@ -5,9 +5,12 @@ #include "opentelemetry/sdk/common/env_variables.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" +#include "opentelemetry/version.h" +#include #include #include +#include OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/batch_span_processor.cc b/sdk/src/trace/batch_span_processor.cc index 3827fad495..7759949490 100644 --- a/sdk/src/trace/batch_span_processor.cc +++ b/sdk/src/trace/batch_span_processor.cc @@ -1,15 +1,32 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/batch_span_processor.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/common/timestamp.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 "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 +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/version.h" using opentelemetry::sdk::common::AtomicUniquePtr; using opentelemetry::sdk::common::CircularBuffer; diff --git a/sdk/src/trace/batch_span_processor_factory.cc b/sdk/src/trace/batch_span_processor_factory.cc index b2b23857a1..a21b056cee 100644 --- a/sdk/src/trace/batch_span_processor_factory.cc +++ b/sdk/src/trace/batch_span_processor_factory.cc @@ -1,9 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/batch_span_processor_factory.h" +#include +#include + #include "opentelemetry/sdk/trace/batch_span_processor.h" +#include "opentelemetry/sdk/trace/batch_span_processor_factory.h" #include "opentelemetry/sdk/trace/batch_span_processor_options.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/random_id_generator.cc b/sdk/src/trace/random_id_generator.cc index e2fa5b0987..f09fa81141 100644 --- a/sdk/src/trace/random_id_generator.cc +++ b/sdk/src/trace/random_id_generator.cc @@ -1,7 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include + +#include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/trace/random_id_generator.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_id.h" #include "opentelemetry/version.h" #include "src/common/random.h" diff --git a/sdk/src/trace/samplers/always_off_factory.cc b/sdk/src/trace/samplers/always_off_factory.cc index e7c802dd51..c148d60ee9 100644 --- a/sdk/src/trace/samplers/always_off_factory.cc +++ b/sdk/src/trace/samplers/always_off_factory.cc @@ -3,8 +3,7 @@ #include "opentelemetry/sdk/trace/samplers/always_off_factory.h" #include "opentelemetry/sdk/trace/samplers/always_off.h" - -namespace trace_api = opentelemetry::trace; +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/samplers/always_on_factory.cc b/sdk/src/trace/samplers/always_on_factory.cc index ad371ac1f0..a803596b9c 100644 --- a/sdk/src/trace/samplers/always_on_factory.cc +++ b/sdk/src/trace/samplers/always_on_factory.cc @@ -3,8 +3,7 @@ #include "opentelemetry/sdk/trace/samplers/always_on_factory.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" - -namespace trace_api = opentelemetry::trace; +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/samplers/parent.cc b/sdk/src/trace/samplers/parent.cc index 990e1a954a..a69ede92d4 100644 --- a/sdk/src/trace/samplers/parent.cc +++ b/sdk/src/trace/samplers/parent.cc @@ -1,8 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#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/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/parent.h" #include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" namespace trace_api = opentelemetry::trace; diff --git a/sdk/src/trace/samplers/parent_factory.cc b/sdk/src/trace/samplers/parent_factory.cc index dd15acff23..978fb75946 100644 --- a/sdk/src/trace/samplers/parent_factory.cc +++ b/sdk/src/trace/samplers/parent_factory.cc @@ -3,8 +3,7 @@ #include "opentelemetry/sdk/trace/samplers/parent_factory.h" #include "opentelemetry/sdk/trace/samplers/parent.h" - -namespace trace_api = opentelemetry::trace; +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/samplers/trace_id_ratio.cc b/sdk/src/trace/samplers/trace_id_ratio.cc index 4d5d3453fa..f25edd2735 100644 --- a/sdk/src/trace/samplers/trace_id_ratio.cc +++ b/sdk/src/trace/samplers/trace_id_ratio.cc @@ -2,11 +2,20 @@ // Copyright 2017, OpenCensus Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/samplers/trace_id_ratio.h" - #include #include -#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/sdk/trace/samplers/trace_id_ratio.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" namespace trace_api = opentelemetry::trace; diff --git a/sdk/src/trace/samplers/trace_id_ratio_factory.cc b/sdk/src/trace/samplers/trace_id_ratio_factory.cc index aaf5dfa4ef..da4c4cc350 100644 --- a/sdk/src/trace/samplers/trace_id_ratio_factory.cc +++ b/sdk/src/trace/samplers/trace_id_ratio_factory.cc @@ -2,10 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h" -#include "opentelemetry/sdk/trace/samplers/parent.h" #include "opentelemetry/sdk/trace/samplers/trace_id_ratio.h" - -namespace trace_api = opentelemetry::trace; +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/simple_processor_factory.cc b/sdk/src/trace/simple_processor_factory.cc index 59e3ea92f1..7e567d22cf 100644 --- a/sdk/src/trace/simple_processor_factory.cc +++ b/sdk/src/trace/simple_processor_factory.cc @@ -1,8 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/simple_processor_factory.h" +#include +#include + +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor.h" +#include "opentelemetry/sdk/trace/simple_processor_factory.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/span.cc b/sdk/src/trace/span.cc index ca3406a154..ca3a475707 100644 --- a/sdk/src/trace/span.cc +++ b/sdk/src/trace/span.cc @@ -1,14 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "src/trace/span.h" -#include "src/common/random.h" +#include +#include -#include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/span_metadata.h" -#include "opentelemetry/trace/trace_flags.h" #include "opentelemetry/version.h" +#include "src/trace/span.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/span.h b/sdk/src/trace/span.h index 7fe86bd3f5..5e0ff2c570 100644 --- a/sdk/src/trace/span.h +++ b/sdk/src/trace/span.h @@ -3,9 +3,20 @@ #pragma once +#include #include +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/tracer.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_context_kv_iterable.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/span_startoptions.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/trace/tracer.cc b/sdk/src/trace/tracer.cc index 838eca88c7..2b38c5d3ca 100644 --- a/sdk/src/trace/tracer.cc +++ b/sdk/src/trace/tracer.cc @@ -1,10 +1,35 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/tracer.h" -#include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/trace/context.h" #include "opentelemetry/trace/noop.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_startoptions.h" +#include "opentelemetry/trace/trace_flags.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/trace_state.h" +#include "opentelemetry/version.h" #include "src/trace/span.h" diff --git a/sdk/src/trace/tracer_context.cc b/sdk/src/trace/tracer_context.cc index 0b89c5cefb..0fb4fd35cf 100644 --- a/sdk/src/trace/tracer_context.cc +++ b/sdk/src/trace/tracer_context.cc @@ -1,8 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/tracer_context.h" +#include +#include +#include +#include + +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/id_generator.h" #include "opentelemetry/sdk/trace/multi_span_processor.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/sdk/trace/tracer_context.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/tracer_context_factory.cc b/sdk/src/trace/tracer_context_factory.cc index df9d81a197..68ea39349e 100644 --- a/sdk/src/trace/tracer_context_factory.cc +++ b/sdk/src/trace/tracer_context_factory.cc @@ -1,11 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/tracer_context_factory.h" -#include "opentelemetry/sdk/trace/multi_span_processor.h" +#include +#include +#include + +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/random_id_generator_factory.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_on_factory.h" #include "opentelemetry/sdk/trace/tracer_context.h" +#include "opentelemetry/sdk/trace/tracer_context_factory.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/tracer_provider.cc b/sdk/src/trace/tracer_provider.cc index 8569b63f23..7421e07de4 100644 --- a/sdk/src/trace/tracer_provider.cc +++ b/sdk/src/trace/tracer_provider.cc @@ -1,12 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/tracer_provider.h" +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/id_generator.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/tracer.h" #include "opentelemetry/sdk/trace/tracer_context.h" -#include "opentelemetry/sdk_config.h" +#include "opentelemetry/sdk/trace/tracer_provider.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/trace/tracer_provider_factory.cc b/sdk/src/trace/tracer_provider_factory.cc index c9b02a13ad..d22330b866 100644 --- a/sdk/src/trace/tracer_provider_factory.cc +++ b/sdk/src/trace/tracer_provider_factory.cc @@ -1,12 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/trace/tracer_provider_factory.h" +#include +#include +#include + +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/id_generator.h" #include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/random_id_generator_factory.h" +#include "opentelemetry/sdk/trace/sampler.h" #include "opentelemetry/sdk/trace/samplers/always_on_factory.h" #include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/sdk/trace/tracer_provider.h" +#include "opentelemetry/sdk/trace/tracer_provider_factory.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" namespace trace_api = opentelemetry::trace; namespace trace_sdk = opentelemetry::sdk::trace;