diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index de60502794..29b8274fbd 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -38,6 +38,7 @@ jobs: 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 \ + -DWITH_DEPRECATED_SDK_FACTORY=OFF \ -DBUILD_W3CTRACECONTEXT_TEST=OFF \ .. diff --git a/CHANGELOG.md b/CHANGELOG.md index cd92d15ba4..f2c08c6065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ Increment the: * [API/SDK] Provider cleanup [#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664) +* [Code health] include-what-you-use cleanup + [#2692](https://github.com/open-telemetry/opentelemetry-cpp/pull/2692) + Important changes: * [API/SDK] Provider cleanup diff --git a/api/include/opentelemetry/nostd/type_traits.h b/api/include/opentelemetry/nostd/type_traits.h index 46d11c89cb..5a087075bf 100644 --- a/api/include/opentelemetry/nostd/type_traits.h +++ b/api/include/opentelemetry/nostd/type_traits.h @@ -15,7 +15,7 @@ # include # include "opentelemetry/config.h" -# include "opentelemetry/nostd/detail/void.h" +# include "opentelemetry/nostd/detail/void.h" // IWYU pragma: export # include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/api/include/opentelemetry/nostd/utility.h b/api/include/opentelemetry/nostd/utility.h index 3238b0328d..de4f47e4cf 100644 --- a/api/include/opentelemetry/nostd/utility.h +++ b/api/include/opentelemetry/nostd/utility.h @@ -15,8 +15,8 @@ # include # include -# include "opentelemetry/nostd/detail/decay.h" -# include "opentelemetry/nostd/detail/invoke.h" +# include "opentelemetry/nostd/detail/decay.h" // IWYU pragma: export +# include "opentelemetry/nostd/detail/invoke.h" // IWYU pragma: export # include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/api/include/opentelemetry/plugin/detail/dynamic_load_unix.h b/api/include/opentelemetry/plugin/detail/dynamic_load_unix.h index 1d249317a0..83522c56eb 100644 --- a/api/include/opentelemetry/plugin/detail/dynamic_load_unix.h +++ b/api/include/opentelemetry/plugin/detail/dynamic_load_unix.h @@ -3,11 +3,10 @@ #pragma once +#include #include #include -#include - #include "opentelemetry/plugin/detail/dynamic_library_handle.h" #include "opentelemetry/plugin/detail/loader_info.h" #include "opentelemetry/plugin/detail/utility.h" diff --git a/api/include/opentelemetry/plugin/dynamic_load.h b/api/include/opentelemetry/plugin/dynamic_load.h index 58a69ad5c8..10b4a34af4 100644 --- a/api/include/opentelemetry/plugin/dynamic_load.h +++ b/api/include/opentelemetry/plugin/dynamic_load.h @@ -7,9 +7,9 @@ #include #ifdef _WIN32 -# include "opentelemetry/plugin/detail/dynamic_load_windows.h" +# include "opentelemetry/plugin/detail/dynamic_load_windows.h" // IWYU pragma: export #else -# include "opentelemetry/plugin/detail/dynamic_load_unix.h" +# include "opentelemetry/plugin/detail/dynamic_load_unix.h" // IWYU pragma: export #endif #include "opentelemetry/version.h" diff --git a/api/include/opentelemetry/plugin/factory.h b/api/include/opentelemetry/plugin/factory.h index 6b484d8f2f..d9df30e480 100644 --- a/api/include/opentelemetry/plugin/factory.h +++ b/api/include/opentelemetry/plugin/factory.h @@ -6,7 +6,7 @@ #include #include -#include "opentelemetry/plugin/detail/utility.h" +#include "opentelemetry/plugin/detail/utility.h" // IWYU pragma: export #include "opentelemetry/plugin/tracer.h" #include "opentelemetry/version.h" diff --git a/api/include/opentelemetry/plugin/tracer.h b/api/include/opentelemetry/plugin/tracer.h index 9f3c7c76d1..ae78109dab 100644 --- a/api/include/opentelemetry/plugin/tracer.h +++ b/api/include/opentelemetry/plugin/tracer.h @@ -6,7 +6,7 @@ #include #include "opentelemetry/common/key_value_iterable.h" -#include "opentelemetry/plugin/detail/tracer_handle.h" +#include "opentelemetry/plugin/detail/tracer_handle.h" // IWYU pragma: export #include "opentelemetry/trace/span_context_kv_iterable.h" #include "opentelemetry/trace/tracer.h" #include "opentelemetry/version.h" diff --git a/examples/batch/main.cc b/examples/batch/main.cc index ece864001a..2a7fba4630 100644 --- a/examples/batch/main.cc +++ b/examples/batch/main.cc @@ -1,17 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include +#include + #include "opentelemetry/exporters/ostream/span_exporter_factory.h" +#include "opentelemetry/nostd/detail/decay.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/batch_span_processor_factory.h" #include "opentelemetry/sdk/trace/batch_span_processor_options.h" -#include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" - -#include -#include +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/trace/tracer_provider.h" constexpr int kNumSpans = 10; namespace trace_api = opentelemetry::trace; diff --git a/examples/common/foo_library/foo_library.cc b/examples/common/foo_library/foo_library.cc index a0dec3c766..e336bc5e4c 100644 --- a/examples/common/foo_library/foo_library.cc +++ b/examples/common/foo_library/foo_library.cc @@ -1,8 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include "opentelemetry/context/context_value.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/version/version.h" #include "opentelemetry/trace/provider.h" +#include "opentelemetry/trace/scope.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/trace/tracer_provider.h" namespace trace = opentelemetry::trace; namespace nostd = opentelemetry::nostd; diff --git a/examples/common/logs_foo_library/foo_library.cc b/examples/common/logs_foo_library/foo_library.cc index d77cd058dc..23402563c6 100644 --- a/examples/common/logs_foo_library/foo_library.cc +++ b/examples/common/logs_foo_library/foo_library.cc @@ -1,11 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include -#include +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/logs/logger.h" +#include "opentelemetry/logs/logger_provider.h" #include "opentelemetry/logs/provider.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/sdk/version/version.h" #include "opentelemetry/trace/provider.h" +#include "opentelemetry/trace/scope.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/trace/tracer_provider.h" namespace logs = opentelemetry::logs; namespace trace = opentelemetry::trace; diff --git a/examples/common/metrics_foo_library/foo_library.cc b/examples/common/metrics_foo_library/foo_library.cc index 79427d195b..dd5f23297b 100644 --- a/examples/common/metrics_foo_library/foo_library.cc +++ b/examples/common/metrics_foo_library/foo_library.cc @@ -1,15 +1,25 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "foo_library.h" +#include +#include #include #include -#include #include +#include #include + +#include "foo_library.h" +#include "opentelemetry/common/key_value_iterable_view.h" #include "opentelemetry/context/context.h" +#include "opentelemetry/metrics/async_instruments.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/metrics/meter_provider.h" +#include "opentelemetry/metrics/observer_result.h" #include "opentelemetry/metrics/provider.h" #include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/nostd/variant.h" namespace nostd = opentelemetry::nostd; namespace metrics_api = opentelemetry::metrics; diff --git a/examples/logs_simple/main.cc b/examples/logs_simple/main.cc index e104724e2a..35827b6502 100644 --- a/examples/logs_simple/main.cc +++ b/examples/logs_simple/main.cc @@ -1,19 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include + #include "opentelemetry/exporters/ostream/log_record_exporter.h" #include "opentelemetry/exporters/ostream/span_exporter_factory.h" +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/logs/logger_provider.h" #include "opentelemetry/logs/provider.h" +#include "opentelemetry/sdk/logs/exporter.h" #include "opentelemetry/sdk/logs/logger_provider.h" #include "opentelemetry/sdk/logs/logger_provider_factory.h" -#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/logs/simple_log_record_processor_factory.h" -#include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" +#include "opentelemetry/trace/tracer_provider.h" #ifdef BAZEL_BUILD # include "examples/common/logs_foo_library/foo_library.h" diff --git a/examples/metrics_simple/metrics_ostream.cc b/examples/metrics_simple/metrics_ostream.cc index 770b2db81a..5871b5e6a3 100644 --- a/examples/metrics_simple/metrics_ostream.cc +++ b/examples/metrics_simple/metrics_ostream.cc @@ -1,20 +1,31 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include +#include +#include +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/exporters/ostream/metric_exporter_factory.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/aggregation/aggregation_config.h" #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h" -#include "opentelemetry/sdk/metrics/meter.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" +#include "opentelemetry/sdk/metrics/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/push_metric_exporter.h" +#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.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/examples/multi_processor/main.cc b/examples/multi_processor/main.cc index 10fe606b30..ceb7cdfcf9 100644 --- a/examples/multi_processor/main.cc +++ b/examples/multi_processor/main.cc @@ -1,13 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include +#include + #include "opentelemetry/exporters/memory/in_memory_span_data.h" #include "opentelemetry/exporters/memory/in_memory_span_exporter_factory.h" #include "opentelemetry/exporters/ostream/span_exporter_factory.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" -#include "opentelemetry/sdk/trace/tracer_context.h" +#include "opentelemetry/sdk/trace/span_data.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/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/tracer_provider.h" #ifdef BAZEL_BUILD # include "examples/common/foo_library/foo_library.h" diff --git a/examples/multithreaded/main.cc b/examples/multithreaded/main.cc index 6071e2597a..9dd76647c5 100644 --- a/examples/multithreaded/main.cc +++ b/examples/multithreaded/main.cc @@ -1,17 +1,27 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + #include "opentelemetry/exporters/ostream/span_exporter_factory.h" +#include "opentelemetry/nostd/detail/decay.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" +#include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" #include "opentelemetry/trace/scope.h" - -#include -#include +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer.h" +#include "opentelemetry/trace/tracer_provider.h" namespace trace_api = opentelemetry::trace; namespace trace_sdk = opentelemetry::sdk::trace; diff --git a/examples/plugin/load/main.cc b/examples/plugin/load/main.cc index 41a04baa48..589f70c2af 100644 --- a/examples/plugin/load/main.cc +++ b/examples/plugin/load/main.cc @@ -1,15 +1,17 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/plugin/dynamic_load.h" - -#include +#include #include #include #include #include #include +#include "opentelemetry/plugin/dynamic_load.h" +#include "opentelemetry/plugin/factory.h" +#include "opentelemetry/trace/tracer.h" + int main(int argc, char *argv[]) { if (argc != 3) diff --git a/examples/plugin/plugin/factory_impl.cc b/examples/plugin/plugin/factory_impl.cc index b262facfb8..4d74bd6062 100644 --- a/examples/plugin/plugin/factory_impl.cc +++ b/examples/plugin/plugin/factory_impl.cc @@ -1,8 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/plugin/factory.h" #include "opentelemetry/plugin/hook.h" +#include "opentelemetry/plugin/tracer.h" #include "tracer.h" namespace nostd = opentelemetry::nostd; diff --git a/examples/plugin/plugin/tracer.cc b/examples/plugin/plugin/tracer.cc index 14d1a746df..faf3f036e5 100644 --- a/examples/plugin/plugin/tracer.cc +++ b/examples/plugin/plugin/tracer.cc @@ -1,11 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "tracer.h" -#include "opentelemetry/nostd/unique_ptr.h" - #include #include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/context/context_value.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_metadata.h" +#include "tracer.h" namespace nostd = opentelemetry::nostd; namespace common = opentelemetry::common; diff --git a/examples/plugin/plugin/tracer.h b/examples/plugin/plugin/tracer.h index 1480b44541..bb933d3d9b 100644 --- a/examples/plugin/plugin/tracer.h +++ b/examples/plugin/plugin/tracer.h @@ -3,8 +3,15 @@ #pragma once +#include #include +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context_kv_iterable.h" +#include "opentelemetry/trace/span_startoptions.h" #include "opentelemetry/trace/tracer.h" class Tracer final : public opentelemetry::trace::Tracer, diff --git a/examples/simple/main.cc b/examples/simple/main.cc index 284ec2f693..a872816ba1 100644 --- a/examples/simple/main.cc +++ b/examples/simple/main.cc @@ -1,13 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include + #include "opentelemetry/exporters/ostream/span_exporter_factory.h" -#include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/tracer_provider.h" #ifdef BAZEL_BUILD # include "examples/common/foo_library/foo_library.h" diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter_factory.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter_factory.h index c55f6a0802..549ff13c71 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter_factory.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter_factory.h @@ -3,8 +3,12 @@ #pragma once +#include +#include + #include "opentelemetry/exporters/memory/in_memory_span_data.h" #include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter.h b/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter.h index 3c11c53aee..24bc8e5be7 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter.h @@ -3,17 +3,21 @@ #pragma once +#include +#include +#include +#include +#include +#include + #include "opentelemetry/common/attribute_value.h" #include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/version.h" -#include -#include -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter_factory.h b/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter_factory.h index 143a481801..36c09a9f74 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter_factory.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter_factory.h @@ -6,17 +6,10 @@ #include #include -#include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace sdk -{ -namespace logs -{ -class LogRecordExporter; -} // namespace logs -} // namespace sdk - namespace exporter { namespace logs diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h b/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h index 0dd22203e5..1ad124a9ab 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h @@ -4,25 +4,22 @@ #pragma once #include +#include #include +#include #include #include +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/exporter_utils.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/metrics/push_metric_exporter.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace sdk -{ -namespace resource -{ -class Resource; -} // namespace resource -} // namespace sdk - namespace exporter { namespace metrics diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter_factory.h b/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter_factory.h index 0526165026..3451769747 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter_factory.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter_factory.h @@ -7,17 +7,10 @@ #include #include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace sdk -{ -namespace metrics -{ -class PushMetricExporter; -} // namespace metrics -} // namespace sdk - namespace exporter { namespace metrics diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter.h b/exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter.h index 153aa4701e..a7de9a5eb4 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter.h @@ -3,16 +3,25 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include + #include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/sdk/trace/span_data.h" #include "opentelemetry/version.h" -#include -#include -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter_factory.h b/exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter_factory.h index 79ba3b06d4..4797473bbb 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter_factory.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter_factory.h @@ -6,17 +6,10 @@ #include #include -#include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE -namespace sdk -{ -namespace trace -{ -class SpanExporter; -} // namespace trace -} // namespace sdk - namespace exporter { namespace trace diff --git a/exporters/ostream/src/log_record_exporter.cc b/exporters/ostream/src/log_record_exporter.cc index 88b8ba5ba2..7f661276c8 100644 --- a/exporters/ostream/src/log_record_exporter.cc +++ b/exporters/ostream/src/log_record_exporter.cc @@ -1,20 +1,38 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/ostream/log_record_exporter.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/exporters/ostream/common_utils.h" +#include "opentelemetry/exporters/ostream/log_record_exporter.h" +#include "opentelemetry/logs/severity.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/logs/read_write_log_record.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk_config.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_flags.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" -#include -#include -#include - -namespace nostd = opentelemetry::nostd; namespace sdklogs = opentelemetry::sdk::logs; namespace sdkcommon = opentelemetry::sdk::common; + OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { @@ -33,7 +51,7 @@ std::unique_ptr OStreamLogRecordExporter::MakeRecordable() } sdk::common::ExportResult OStreamLogRecordExporter::Export( - const nostd::span> &records) noexcept + const opentelemetry::nostd::span> &records) noexcept { if (isShutdown()) { diff --git a/exporters/ostream/src/log_record_exporter_factory.cc b/exporters/ostream/src/log_record_exporter_factory.cc index 66ea1a0232..31539c5182 100644 --- a/exporters/ostream/src/log_record_exporter_factory.cc +++ b/exporters/ostream/src/log_record_exporter_factory.cc @@ -3,6 +3,8 @@ #include "opentelemetry/exporters/ostream/log_record_exporter_factory.h" #include "opentelemetry/exporters/ostream/log_record_exporter.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/version.h" namespace logs_sdk = opentelemetry::sdk::logs; diff --git a/exporters/ostream/src/metric_exporter.cc b/exporters/ostream/src/metric_exporter.cc index 4871a28b3d..08bfe340c7 100644 --- a/exporters/ostream/src/metric_exporter.cc +++ b/exporters/ostream/src/metric_exporter.cc @@ -1,19 +1,35 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/ostream/metric_exporter.h" -#include "opentelemetry/exporters/ostream/common_utils.h" -#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" -#include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk_config.h" - +#include #include +#include #include #include +#include #include #include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/exporters/ostream/common_utils.h" +#include "opentelemetry/exporters/ostream/metric_exporter.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/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 { diff --git a/exporters/ostream/src/span_exporter.cc b/exporters/ostream/src/span_exporter.cc index 4faa6854be..d3f5093b40 100644 --- a/exporters/ostream/src/span_exporter.cc +++ b/exporters/ostream/src/span_exporter.cc @@ -1,14 +1,36 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/exporters/ostream/span_exporter.h" -#include "opentelemetry/exporters/ostream/common_utils.h" - +#include +#include #include -#include -#include "opentelemetry/sdk_config.h" +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/exporters/ostream/common_utils.h" +#include "opentelemetry/exporters/ostream/span_exporter.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/common/exporter_utils.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/recordable.h" +#include "opentelemetry/sdk/trace/span_data.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/trace_state.h" +#include "opentelemetry/version.h" -namespace nostd = opentelemetry::nostd; namespace trace_sdk = opentelemetry::sdk::trace; namespace trace_api = opentelemetry::trace; namespace sdkcommon = opentelemetry::sdk::common; @@ -45,7 +67,7 @@ std::unique_ptr OStreamSpanExporter::MakeRecordable() noe } sdk::common::ExportResult OStreamSpanExporter::Export( - const nostd::span> &spans) noexcept + const opentelemetry::nostd::span> &spans) noexcept { if (isShutdown()) { diff --git a/exporters/ostream/src/span_exporter_factory.cc b/exporters/ostream/src/span_exporter_factory.cc index 5b3061ac3c..fdb08f150f 100644 --- a/exporters/ostream/src/span_exporter_factory.cc +++ b/exporters/ostream/src/span_exporter_factory.cc @@ -3,6 +3,8 @@ #include "opentelemetry/exporters/ostream/span_exporter_factory.h" #include "opentelemetry/exporters/ostream/span_exporter.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/version.h" namespace trace_sdk = opentelemetry::sdk::trace; diff --git a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h index 01a39348e2..b52476071a 100644 --- a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h +++ b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h @@ -3,18 +3,22 @@ #pragma once -#include "opentelemetry/sdk/common/circular_buffer.h" -#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h" -#include "opentelemetry/sdk/logs/exporter.h" -#include "opentelemetry/sdk/logs/processor.h" -#include "opentelemetry/version.h" - +#include #include +#include #include #include #include +#include #include +#include "opentelemetry/sdk/common/circular_buffer.h" +#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_factory.h b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_factory.h index 74e0efbb59..983f2e7508 100644 --- a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_factory.h +++ b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_factory.h @@ -5,6 +5,9 @@ #include +#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -14,10 +17,6 @@ namespace sdk namespace logs { -struct BatchLogRecordProcessorOptions; -class LogRecordExporter; -class LogRecordProcessor; - /** * Factory class for BatchLogRecordProcessor. */ diff --git a/sdk/include/opentelemetry/sdk/logs/event_logger.h b/sdk/include/opentelemetry/sdk/logs/event_logger.h index 8230beeb32..d9e83b9998 100644 --- a/sdk/include/opentelemetry/sdk/logs/event_logger.h +++ b/sdk/include/opentelemetry/sdk/logs/event_logger.h @@ -6,6 +6,8 @@ #include #include "opentelemetry/logs/event_logger.h" +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/logs/logger.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/nostd/unique_ptr.h" @@ -16,9 +18,6 @@ namespace sdk { namespace logs { -class Logger; -class LogRecord; - class EventLogger final : public opentelemetry::logs::EventLogger { public: diff --git a/sdk/include/opentelemetry/sdk/logs/event_logger_provider.h b/sdk/include/opentelemetry/sdk/logs/event_logger_provider.h index 4572647356..9e7ff4d866 100644 --- a/sdk/include/opentelemetry/sdk/logs/event_logger_provider.h +++ b/sdk/include/opentelemetry/sdk/logs/event_logger_provider.h @@ -3,7 +3,9 @@ #pragma once +#include "opentelemetry/logs/event_logger.h" #include "opentelemetry/logs/event_logger_provider.h" +#include "opentelemetry/logs/logger.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/version.h" @@ -17,9 +19,6 @@ namespace sdk { namespace logs { -class EventLogger; -class Logger; - class OPENTELEMETRY_EXPORT EventLoggerProvider final : public opentelemetry::logs::EventLoggerProvider { diff --git a/sdk/include/opentelemetry/sdk/logs/exporter.h b/sdk/include/opentelemetry/sdk/logs/exporter.h index 68c61603fa..15e848f351 100644 --- a/sdk/include/opentelemetry/sdk/logs/exporter.h +++ b/sdk/include/opentelemetry/sdk/logs/exporter.h @@ -8,6 +8,7 @@ #include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/common/exporter_utils.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -15,8 +16,6 @@ namespace sdk { namespace logs { -class Recordable; - /** * LogRecordExporter defines the interface that log exporters must implement. */ diff --git a/sdk/include/opentelemetry/sdk/logs/logger.h b/sdk/include/opentelemetry/sdk/logs/logger.h index fbbf4f28a5..ed43d1ce55 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger.h +++ b/sdk/include/opentelemetry/sdk/logs/logger.h @@ -6,7 +6,7 @@ #include #include -#include "opentelemetry/common/macros.h" +#include "opentelemetry/logs/log_record.h" #include "opentelemetry/logs/logger.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/nostd/unique_ptr.h" @@ -19,7 +19,6 @@ namespace sdk { namespace logs { -class LoggerProvider; class Logger final : public opentelemetry::logs::Logger { diff --git a/sdk/include/opentelemetry/sdk/logs/logger_context_factory.h b/sdk/include/opentelemetry/sdk/logs/logger_context_factory.h index 9f8a8a54ba..5565be8a62 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger_context_factory.h +++ b/sdk/include/opentelemetry/sdk/logs/logger_context_factory.h @@ -6,20 +6,16 @@ #include #include +#include "opentelemetry/sdk/logs/logger_context.h" +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { -namespace resource -{ -class Resource; -} // namespace resource - namespace logs { -class LoggerContext; -class LogRecordProcessor; /** * Factory class for LoggerContext. diff --git a/sdk/include/opentelemetry/sdk/logs/logger_provider.h b/sdk/include/opentelemetry/sdk/logs/logger_provider.h index bced6061f5..bf116b4272 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger_provider.h +++ b/sdk/include/opentelemetry/sdk/logs/logger_provider.h @@ -3,13 +3,19 @@ #pragma once +#include #include #include #include +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/logs/logger.h" #include "opentelemetry/logs/logger_provider.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/logs/logger.h" +#include "opentelemetry/sdk/logs/logger_context.h" +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" @@ -22,10 +28,6 @@ namespace sdk { namespace logs { -class Logger; -class LoggerContext; -class LogRecordProcessor; - class OPENTELEMETRY_EXPORT LoggerProvider final : public opentelemetry::logs::LoggerProvider { public: diff --git a/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h b/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h index 8ca5cffcca..46432ef22e 100644 --- a/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h +++ b/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h @@ -8,6 +8,7 @@ #include #include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -15,8 +16,6 @@ namespace sdk { namespace logs { -class Recordable; - /** * Log processor allow hooks for receive method invocations. * diff --git a/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor_factory.h b/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor_factory.h index 26bd9152ce..351b9c0f7f 100644 --- a/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor_factory.h +++ b/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor_factory.h @@ -6,6 +6,7 @@ #include #include +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -13,7 +14,6 @@ namespace sdk { namespace logs { -class LogRecordProcessor; /** * Factory class for MultiLogRecordProcessor. diff --git a/sdk/include/opentelemetry/sdk/logs/multi_recordable.h b/sdk/include/opentelemetry/sdk/logs/multi_recordable.h index 1eb4b1a221..40a9c92e3b 100644 --- a/sdk/include/opentelemetry/sdk/logs/multi_recordable.h +++ b/sdk/include/opentelemetry/sdk/logs/multi_recordable.h @@ -3,11 +3,17 @@ #pragma once +#include #include #include #include +#include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/macros.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" @@ -17,8 +23,6 @@ namespace sdk { namespace logs { -class LogRecordProcessor; - class MultiRecordable final : public Recordable { public: diff --git a/sdk/include/opentelemetry/sdk/logs/readable_log_record.h b/sdk/include/opentelemetry/sdk/logs/readable_log_record.h index a8f366b5b7..2222def9d2 100644 --- a/sdk/include/opentelemetry/sdk/logs/readable_log_record.h +++ b/sdk/include/opentelemetry/sdk/logs/readable_log_record.h @@ -3,14 +3,18 @@ #pragma once +#include #include #include #include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/timestamp.h" +#include "opentelemetry/logs/log_record.h" #include "opentelemetry/logs/severity.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor.h b/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor.h index a65c0eb7a9..23b6efa46f 100644 --- a/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor.h +++ b/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor.h @@ -8,7 +8,9 @@ #include #include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/sdk/logs/exporter.h" #include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -16,9 +18,6 @@ namespace sdk { namespace logs { -class LogRecordExporter; -class Recordable; - /** * The simple log processor passes all log records * in a batch of 1 to the configured diff --git a/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor_factory.h b/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor_factory.h index 295addce11..0b9df81c1e 100644 --- a/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor_factory.h +++ b/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor_factory.h @@ -5,6 +5,7 @@ #include +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -13,7 +14,6 @@ namespace sdk namespace logs { class LogRecordExporter; -class LogRecordProcessor; /** * Factory class for SimpleLogRecordProcessor. diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h index 04293e696f..c5cfcfd897 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h @@ -3,11 +3,17 @@ #pragma once +#include +#include #include #include +#include #include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h index 859fe26d6b..e8e6c40a30 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h @@ -3,10 +3,12 @@ #pragma once +#include #include #include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h index a098d86b72..035a8df84d 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h @@ -3,10 +3,12 @@ #pragma once +#include #include #include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/data/circular_buffer.h b/sdk/include/opentelemetry/sdk/metrics/data/circular_buffer.h index 32605dfd68..db4de054f4 100644 --- a/sdk/include/opentelemetry/sdk/metrics/data/circular_buffer.h +++ b/sdk/include/opentelemetry/sdk/metrics/data/circular_buffer.h @@ -3,12 +3,14 @@ #pragma once -#include "opentelemetry/nostd/variant.h" - +#include #include #include #include +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h b/sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h index 9fb0fbf5a0..d72ec08839 100644 --- a/sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h +++ b/sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h @@ -12,7 +12,9 @@ #include #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -21,8 +23,6 @@ namespace sdk namespace metrics { -class PushMetricExporter; - class PeriodicExportingMetricReader : public MetricReader { diff --git a/sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h b/sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h index 1c5c1a0d7b..8cb439599e 100644 --- a/sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h +++ b/sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h @@ -3,8 +3,11 @@ #pragma once +#include + #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" #include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -13,9 +16,6 @@ namespace sdk namespace metrics { -class MetricReader; -class PushMetricExporter; - class OPENTELEMETRY_EXPORT PeriodicExportingMetricReaderFactory { public: diff --git a/sdk/include/opentelemetry/sdk/metrics/instrument_metadata_validator.h b/sdk/include/opentelemetry/sdk/metrics/instrument_metadata_validator.h index fec1027746..a24d6db734 100644 --- a/sdk/include/opentelemetry/sdk/metrics/instrument_metadata_validator.h +++ b/sdk/include/opentelemetry/sdk/metrics/instrument_metadata_validator.h @@ -3,9 +3,6 @@ #pragma once -#include - -#include "opentelemetry/common/macros.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/meter_context.h b/sdk/include/opentelemetry/sdk/metrics/meter_context.h index 2dfa2db56e..40a57a6f88 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter_context.h +++ b/sdk/include/opentelemetry/sdk/metrics/meter_context.h @@ -12,15 +12,20 @@ #include "opentelemetry/common/timestamp.h" #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.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 sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/metric_reader.h b/sdk/include/opentelemetry/sdk/metrics/metric_reader.h index 126ad92282..30d5e60823 100644 --- a/sdk/include/opentelemetry/sdk/metrics/metric_reader.h +++ b/sdk/include/opentelemetry/sdk/metrics/metric_reader.h @@ -5,10 +5,9 @@ #include #include -#include #include "opentelemetry/nostd/function_ref.h" -#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/version.h" @@ -17,9 +16,6 @@ namespace sdk { namespace metrics { -class MetricProducer; -struct ResourceMetrics; - /** * MetricReader defines the interface to collect metrics from SDK */ diff --git a/sdk/include/opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h b/sdk/include/opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h index f9880b5073..329e75bfa7 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h @@ -3,9 +3,13 @@ #pragma once -#include -#include -#include "opentelemetry/sdk/common/attributemap_hash.h" +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -13,7 +17,8 @@ namespace sdk { namespace metrics { -class AttributesProcessor; +class AttributesProcessor; // IWYU pragma: keep + class FilteredOrderedAttributeMap : public opentelemetry::sdk::common::OrderedAttributeMap { public: diff --git a/sdk/include/opentelemetry/sdk/metrics/state/metric_collector.h b/sdk/include/opentelemetry/sdk/metrics/state/metric_collector.h index bf0a9ba86b..e652ba12a9 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/metric_collector.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/metric_collector.h @@ -6,8 +6,10 @@ #include #include +#include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h index 031bab2f61..0e4d288d6e 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h @@ -3,26 +3,25 @@ #pragma once +#include +#include #include -#include #include #include -#include -#include +#include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/context/context.h" #include "opentelemetry/nostd/function_ref.h" -#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/span.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/attributemap_hash.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" - -#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW -# include "opentelemetry/sdk/metrics/exemplar/filter_type.h" -# include "opentelemetry/sdk/metrics/exemplar/reservoir.h" -#endif - +#include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" #include "opentelemetry/sdk/metrics/state/metric_collector.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" @@ -30,6 +29,11 @@ #include "opentelemetry/sdk/metrics/view/attributes_processor.h" #include "opentelemetry/version.h" +#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW +# include "opentelemetry/sdk/metrics/exemplar/filter_type.h" +# include "opentelemetry/sdk/metrics/exemplar/reservoir.h" +#endif + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/state/temporal_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/temporal_metric_storage.h index 0a08e7d100..2d01710e47 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/temporal_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/temporal_metric_storage.h @@ -11,7 +11,10 @@ #include "opentelemetry/common/timestamp.h" #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -19,10 +22,6 @@ namespace sdk { namespace metrics { -class AggregationConfig; -class AttributesHashMap; -class CollectorHandle; -class MetricData; struct LastReportedMetrics { diff --git a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h b/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h index f08b629fe2..1d2c5bf25f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h @@ -3,8 +3,12 @@ #pragma once +#include #include +#include +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/context/context.h" #include "opentelemetry/metrics/sync_instruments.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" @@ -17,9 +21,6 @@ namespace sdk namespace metrics { -// forward declaration -class SyncWritableMetricStorage; - class Synchronous { public: diff --git a/sdk/include/opentelemetry/sdk/metrics/view/instrument_selector_factory.h b/sdk/include/opentelemetry/sdk/metrics/view/instrument_selector_factory.h index 3c221f123b..a2db241e98 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/instrument_selector_factory.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/instrument_selector_factory.h @@ -3,9 +3,12 @@ #pragma once +#include #include #include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/view/instrument_selector.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk @@ -13,8 +16,6 @@ namespace sdk namespace metrics { -class InstrumentSelector; - class OPENTELEMETRY_EXPORT InstrumentSelectorFactory { public: diff --git a/sdk/include/opentelemetry/sdk/metrics/view/meter_selector_factory.h b/sdk/include/opentelemetry/sdk/metrics/view/meter_selector_factory.h index 47aa77b772..19cee41629 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/meter_selector_factory.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/meter_selector_factory.h @@ -6,6 +6,7 @@ #include #include +#include "opentelemetry/sdk/metrics/view/meter_selector.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -14,8 +15,6 @@ namespace sdk namespace metrics { -class MeterSelector; - class OPENTELEMETRY_EXPORT MeterSelectorFactory { public: diff --git a/sdk/include/opentelemetry/sdk/metrics/view/view_factory.h b/sdk/include/opentelemetry/sdk/metrics/view/view_factory.h index 22d34bf506..2fa1733f92 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/view_factory.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/view_factory.h @@ -3,12 +3,14 @@ #pragma once -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/nostd/string_view.h" +#include +#include + #include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" +#include "opentelemetry/sdk/metrics/view/view.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk @@ -16,8 +18,6 @@ namespace sdk namespace metrics { -class View; - /** * Factory class for View. */ diff --git a/sdk/include/opentelemetry/sdk/metrics/view/view_registry_factory.h b/sdk/include/opentelemetry/sdk/metrics/view/view_registry_factory.h index f8f83c21ad..3592e95512 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/view_registry_factory.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/view_registry_factory.h @@ -5,6 +5,7 @@ #include +#include "opentelemetry/sdk/metrics/view/view_registry.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,9 +13,6 @@ namespace sdk { namespace metrics { - -class ViewRegistry; - class ViewRegistryFactory { public: diff --git a/sdk/include/opentelemetry/sdk/version/version.h b/sdk/include/opentelemetry/sdk/version/version.h index f7f6f4f0fd..f98c5c433f 100644 --- a/sdk/include/opentelemetry/sdk/version/version.h +++ b/sdk/include/opentelemetry/sdk/version/version.h @@ -3,8 +3,6 @@ #pragma once -#include "opentelemetry/detail/preprocessor.h" - #define OPENTELEMETRY_SDK_VERSION "1.15.0" #include "opentelemetry/version.h" diff --git a/sdk/src/logs/batch_log_record_processor.cc b/sdk/src/logs/batch_log_record_processor.cc index c29e27bdd3..c85d56739e 100644 --- a/sdk/src/logs/batch_log_record_processor.cc +++ b/sdk/src/logs/batch_log_record_processor.cc @@ -1,12 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/batch_log_record_processor.h" -#include "opentelemetry/common/spin_lock_mutex.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #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/logs/batch_log_record_processor.h" +#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h" +#include "opentelemetry/sdk/logs/exporter.h" #include "opentelemetry/sdk/logs/recordable.h" - -#include +#include "opentelemetry/version.h" using opentelemetry::sdk::common::AtomicUniquePtr; using opentelemetry::sdk::common::CircularBufferRange; diff --git a/sdk/src/logs/batch_log_record_processor_factory.cc b/sdk/src/logs/batch_log_record_processor_factory.cc index dabd0f4ff8..a6e29e4967 100644 --- a/sdk/src/logs/batch_log_record_processor_factory.cc +++ b/sdk/src/logs/batch_log_record_processor_factory.cc @@ -1,8 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/batch_log_record_processor_factory.h" +#include +#include + #include "opentelemetry/sdk/logs/batch_log_record_processor.h" +#include "opentelemetry/sdk/logs/batch_log_record_processor_factory.h" +#include "opentelemetry/sdk/logs/batch_log_record_processor_options.h" +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/event_logger.cc b/sdk/src/logs/event_logger.cc index c9dd5c35b5..6b0afacfaf 100644 --- a/sdk/src/logs/event_logger.cc +++ b/sdk/src/logs/event_logger.cc @@ -1,23 +1,30 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include + +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/logs/logger.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/logs/event_logger.h" -#include "opentelemetry/sdk_config.h" -#include "opentelemetry/trace/provider.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace logs { -namespace nostd = opentelemetry::nostd; -EventLogger::EventLogger(nostd::shared_ptr delegate_logger, - nostd::string_view event_domain) noexcept +EventLogger::EventLogger( + opentelemetry::nostd::shared_ptr delegate_logger, + opentelemetry::nostd::string_view event_domain) noexcept : delegate_logger_(delegate_logger), event_domain_(event_domain) {} -const nostd::string_view EventLogger::GetName() noexcept +const opentelemetry::nostd::string_view EventLogger::GetName() noexcept { if (delegate_logger_) { @@ -27,13 +34,15 @@ const nostd::string_view EventLogger::GetName() noexcept return {}; } -nostd::shared_ptr EventLogger::GetDelegateLogger() noexcept +opentelemetry::nostd::shared_ptr +EventLogger::GetDelegateLogger() noexcept { return delegate_logger_; } -void EventLogger::EmitEvent(nostd::string_view event_name, - nostd::unique_ptr &&log_record) noexcept +void EventLogger::EmitEvent( + opentelemetry::nostd::string_view event_name, + opentelemetry::nostd::unique_ptr &&log_record) noexcept { if (!delegate_logger_ || !log_record) { diff --git a/sdk/src/logs/event_logger_provider.cc b/sdk/src/logs/event_logger_provider.cc index 28a88d82e2..570a64f82d 100644 --- a/sdk/src/logs/event_logger_provider.cc +++ b/sdk/src/logs/event_logger_provider.cc @@ -2,21 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/sdk/logs/event_logger_provider.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/logs/event_logger.h" - -#include -#include -#include -#include -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace logs { -namespace nostd = opentelemetry::nostd; EventLoggerProvider::EventLoggerProvider() noexcept { @@ -25,11 +20,12 @@ EventLoggerProvider::EventLoggerProvider() noexcept EventLoggerProvider::~EventLoggerProvider() {} -nostd::shared_ptr EventLoggerProvider::CreateEventLogger( - nostd::shared_ptr delegate_logger, - nostd::string_view event_domain) noexcept +opentelemetry::nostd::shared_ptr +EventLoggerProvider::CreateEventLogger( + opentelemetry::nostd::shared_ptr delegate_logger, + opentelemetry::nostd::string_view event_domain) noexcept { - return nostd::shared_ptr{ + return opentelemetry::nostd::shared_ptr{ new EventLogger(delegate_logger, event_domain)}; } diff --git a/sdk/src/logs/logger.cc b/sdk/src/logs/logger.cc index 972b380efc..d3555ba4ec 100644 --- a/sdk/src/logs/logger.cc +++ b/sdk/src/logs/logger.cc @@ -1,12 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/logger.h" +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/context/context_value.h" #include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/logs/log_record.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/logs/logger.h" +#include "opentelemetry/sdk/logs/logger_context.h" #include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/logs/recordable.h" -#include "opentelemetry/sdk_config.h" -#include "opentelemetry/trace/provider.h" +#include "opentelemetry/trace/span.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk @@ -14,11 +31,10 @@ namespace sdk namespace logs { namespace trace_api = opentelemetry::trace; -namespace nostd = opentelemetry::nostd; namespace common = opentelemetry::common; Logger::Logger( - nostd::string_view name, + opentelemetry::nostd::string_view name, std::shared_ptr context, std::unique_ptr instrumentation_scope) noexcept : logger_name_(std::string(name)), @@ -26,12 +42,12 @@ Logger::Logger( context_(context) {} -const nostd::string_view Logger::GetName() noexcept +const opentelemetry::nostd::string_view Logger::GetName() noexcept { return logger_name_; } -nostd::unique_ptr Logger::CreateLogRecord() noexcept +opentelemetry::nostd::unique_ptr Logger::CreateLogRecord() noexcept { auto recordable = context_->GetProcessor().MakeRecordable(); @@ -42,10 +58,12 @@ nostd::unique_ptr Logger::CreateLogRecord() noex opentelemetry::context::ContextValue context_value = opentelemetry::context::RuntimeContext::GetCurrent().GetValue( opentelemetry::trace::kSpanKey); - if (nostd::holds_alternative>(context_value)) + if (opentelemetry::nostd::holds_alternative< + opentelemetry::nostd::shared_ptr>(context_value)) { - nostd::shared_ptr &data = - nostd::get>(context_value); + opentelemetry::nostd::shared_ptr &data = + opentelemetry::nostd::get>( + context_value); if (data) { recordable->SetTraceId(data->GetContext().trace_id()); @@ -53,10 +71,12 @@ nostd::unique_ptr Logger::CreateLogRecord() noex recordable->SetSpanId(data->GetContext().span_id()); } } - else if (nostd::holds_alternative>(context_value)) + else if (opentelemetry::nostd::holds_alternative< + opentelemetry::nostd::shared_ptr>(context_value)) { - nostd::shared_ptr &data = - nostd::get>(context_value); + opentelemetry::nostd::shared_ptr &data = + opentelemetry::nostd::get>( + context_value); if (data) { recordable->SetTraceId(data->trace_id()); @@ -66,10 +86,11 @@ nostd::unique_ptr Logger::CreateLogRecord() noex } } - return nostd::unique_ptr(recordable.release()); + return opentelemetry::nostd::unique_ptr(recordable.release()); } -void Logger::EmitLogRecord(nostd::unique_ptr &&log_record) noexcept +void Logger::EmitLogRecord( + opentelemetry::nostd::unique_ptr &&log_record) noexcept { if (!log_record) { diff --git a/sdk/src/logs/logger_context.cc b/sdk/src/logs/logger_context.cc index 357d13193d..2bfb89161e 100644 --- a/sdk/src/logs/logger_context.cc +++ b/sdk/src/logs/logger_context.cc @@ -1,12 +1,17 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/logger_context.h" -#include "opentelemetry/sdk/logs/multi_log_record_processor.h" - +#include #include +#include #include +#include "opentelemetry/sdk/logs/logger_context.h" +#include "opentelemetry/sdk/logs/multi_log_record_processor.h" +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/src/logs/logger_context_factory.cc b/sdk/src/logs/logger_context_factory.cc index ff57747f80..f11852be7f 100644 --- a/sdk/src/logs/logger_context_factory.cc +++ b/sdk/src/logs/logger_context_factory.cc @@ -1,13 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/logger_context_factory.h" +#include +#include +#include + #include "opentelemetry/sdk/logs/logger_context.h" +#include "opentelemetry/sdk/logs/logger_context_factory.h" #include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/resource/resource.h" - -#include -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/logger_provider.cc b/sdk/src/logs/logger_provider.cc index 46eaa01054..c3b1fb7dd4 100644 --- a/sdk/src/logs/logger_provider.cc +++ b/sdk/src/logs/logger_provider.cc @@ -1,12 +1,26 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/logger_provider.h" +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/logs/logger.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/logs/logger.h" #include "opentelemetry/sdk/logs/logger_context.h" +#include "opentelemetry/sdk/logs/logger_provider.h" #include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk @@ -14,9 +28,6 @@ namespace sdk namespace logs { -namespace nostd = opentelemetry::nostd; -namespace logs_api = opentelemetry::logs; - LoggerProvider::LoggerProvider(std::unique_ptr &&processor, opentelemetry::sdk::resource::Resource resource) noexcept { @@ -50,11 +61,11 @@ LoggerProvider::~LoggerProvider() } } -nostd::shared_ptr LoggerProvider::GetLogger( - nostd::string_view logger_name, - nostd::string_view library_name, - nostd::string_view library_version, - nostd::string_view schema_url, +opentelemetry::nostd::shared_ptr LoggerProvider::GetLogger( + opentelemetry::nostd::string_view logger_name, + opentelemetry::nostd::string_view library_name, + opentelemetry::nostd::string_view library_version, + opentelemetry::nostd::string_view schema_url, const opentelemetry::common::KeyValueIterable &attributes) noexcept { // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-instrumentationscope @@ -73,7 +84,7 @@ nostd::shared_ptr LoggerProvider::GetLogger( if (logger->GetName() == logger_name && logger_lib.equal(library_name, library_version, schema_url)) { - return nostd::shared_ptr{logger}; + return opentelemetry::nostd::shared_ptr{logger}; } } @@ -96,7 +107,7 @@ nostd::shared_ptr LoggerProvider::GetLogger( loggers_.push_back(std::shared_ptr( new Logger(logger_name, context_, std::move(lib)))); - return nostd::shared_ptr{loggers_.back()}; + return opentelemetry::nostd::shared_ptr{loggers_.back()}; } void LoggerProvider::AddProcessor(std::unique_ptr processor) noexcept diff --git a/sdk/src/logs/logger_provider_factory.cc b/sdk/src/logs/logger_provider_factory.cc index 8c169866ff..08567c65d9 100644 --- a/sdk/src/logs/logger_provider_factory.cc +++ b/sdk/src/logs/logger_provider_factory.cc @@ -1,12 +1,16 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include #include "opentelemetry/sdk/logs/logger_context.h" #include "opentelemetry/sdk/logs/logger_provider.h" #include "opentelemetry/sdk/logs/logger_provider_factory.h" +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/multi_log_record_processor.cc b/sdk/src/logs/multi_log_record_processor.cc index c0b3eb1ec6..efc1cbd1b4 100644 --- a/sdk/src/logs/multi_log_record_processor.cc +++ b/sdk/src/logs/multi_log_record_processor.cc @@ -1,9 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include +#include + #include "opentelemetry/sdk/logs/multi_log_record_processor.h" #include "opentelemetry/sdk/logs/multi_recordable.h" +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/multi_log_record_processor_factory.cc b/sdk/src/logs/multi_log_record_processor_factory.cc index ab49689ca0..f51c851a28 100644 --- a/sdk/src/logs/multi_log_record_processor_factory.cc +++ b/sdk/src/logs/multi_log_record_processor_factory.cc @@ -1,13 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/multi_log_record_processor_factory.h" -#include "opentelemetry/sdk/logs/multi_log_record_processor.h" - -#include #include +#include #include +#include "opentelemetry/sdk/logs/multi_log_record_processor.h" +#include "opentelemetry/sdk/logs/multi_log_record_processor_factory.h" +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/src/logs/multi_recordable.cc b/sdk/src/logs/multi_recordable.cc index 7d80259f27..53c2b25e33 100644 --- a/sdk/src/logs/multi_recordable.cc +++ b/sdk/src/logs/multi_recordable.cc @@ -1,11 +1,21 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/multi_recordable.h" - +#include #include #include #include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/logs/log_record.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/logs/multi_recordable.h" +#include "opentelemetry/sdk/logs/processor.h" +#include "opentelemetry/sdk/logs/recordable.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/read_write_log_record.cc b/sdk/src/logs/read_write_log_record.cc index 27dd8f7d5f..48c9a2699d 100644 --- a/sdk/src/logs/read_write_log_record.cc +++ b/sdk/src/logs/read_write_log_record.cc @@ -1,10 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include -#include - +#include +#include +#include +#include +#include + +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/logs/severity.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/logs/read_write_log_record.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/trace/span_id.h" +#include "opentelemetry/trace/trace_flags.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/readable_log_record.cc b/sdk/src/logs/readable_log_record.cc index 80493354e3..4c8d119347 100644 --- a/sdk/src/logs/readable_log_record.cc +++ b/sdk/src/logs/readable_log_record.cc @@ -1,13 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/readable_log_record.h" +#include +#include +#include + +#include "opentelemetry/logs/severity.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/sdk/logs/readable_log_record.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/version/version.h" - -#include -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/simple_log_record_processor.cc b/sdk/src/logs/simple_log_record_processor.cc index 68f90e83ab..7e65f31ca4 100644 --- a/sdk/src/logs/simple_log_record_processor.cc +++ b/sdk/src/logs/simple_log_record_processor.cc @@ -1,12 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/simple_log_record_processor.h" +#include +#include +#include +#include +#include + +#include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/logs/exporter.h" #include "opentelemetry/sdk/logs/recordable.h" - -#include +#include "opentelemetry/sdk/logs/simple_log_record_processor.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/simple_log_record_processor_factory.cc b/sdk/src/logs/simple_log_record_processor_factory.cc index 6146efc174..88e1b4b1ee 100644 --- a/sdk/src/logs/simple_log_record_processor_factory.cc +++ b/sdk/src/logs/simple_log_record_processor_factory.cc @@ -1,8 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/logs/simple_log_record_processor_factory.h" +#include +#include + +#include "opentelemetry/sdk/logs/exporter.h" +#include "opentelemetry/sdk/logs/processor.h" #include "opentelemetry/sdk/logs/simple_log_record_processor.h" +#include "opentelemetry/sdk/logs/simple_log_record_processor_factory.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/aggregation/histogram_aggregation.cc b/sdk/src/metrics/aggregation/histogram_aggregation.cc index 8e14ddec7a..da725cf09c 100644 --- a/sdk/src/metrics/aggregation/histogram_aggregation.cc +++ b/sdk/src/metrics/aggregation/histogram_aggregation.cc @@ -1,15 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" -#include "opentelemetry/version.h" - +#include #include -#include +#include #include #include #include +#include +#include + +#include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" +#include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/aggregation/lastvalue_aggregation.cc b/sdk/src/metrics/aggregation/lastvalue_aggregation.cc index 50904f8184..0380015234 100644 --- a/sdk/src/metrics/aggregation/lastvalue_aggregation.cc +++ b/sdk/src/metrics/aggregation/lastvalue_aggregation.cc @@ -1,12 +1,21 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h" +#include +#include +#include +#include +#include + +#include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/version.h" -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/src/metrics/aggregation/sum_aggregation.cc b/sdk/src/metrics/aggregation/sum_aggregation.cc index 0901a7bbdd..1e0442e92c 100644 --- a/sdk/src/metrics/aggregation/sum_aggregation.cc +++ b/sdk/src/metrics/aggregation/sum_aggregation.cc @@ -1,14 +1,20 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/aggregation/sum_aggregation.h" +#include +#include +#include +#include + +#include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/aggregation/sum_aggregation.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" #include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/version.h" -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/src/metrics/async_instruments.cc b/sdk/src/metrics/async_instruments.cc index 88f818dad9..311efc1e7e 100644 --- a/sdk/src/metrics/async_instruments.cc +++ b/sdk/src/metrics/async_instruments.cc @@ -1,9 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include +#include "opentelemetry/metrics/async_instruments.h" #include "opentelemetry/sdk/metrics/async_instruments.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" diff --git a/sdk/src/metrics/data/circular_buffer.cc b/sdk/src/metrics/data/circular_buffer.cc index e2bd6e8ec0..007bedef6d 100644 --- a/sdk/src/metrics/data/circular_buffer.cc +++ b/sdk/src/metrics/data/circular_buffer.cc @@ -1,7 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/metrics/data/circular_buffer.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/exemplar/reservoir.cc b/sdk/src/metrics/exemplar/reservoir.cc index d695587a91..4e7501799e 100644 --- a/sdk/src/metrics/exemplar/reservoir.cc +++ b/sdk/src/metrics/exemplar/reservoir.cc @@ -1,13 +1,11 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include - #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW +# include "opentelemetry/sdk/metrics/exemplar/reservoir.h" # include "opentelemetry/sdk/metrics/exemplar/aligned_histogram_bucket_exemplar_reservoir.h" # include "opentelemetry/sdk/metrics/exemplar/no_exemplar_reservoir.h" -# include "opentelemetry/sdk/metrics/exemplar/reservoir.h" # include "opentelemetry/sdk/metrics/exemplar/reservoir_cell.h" # include "opentelemetry/sdk/metrics/exemplar/simple_fixed_size_exemplar_reservoir.h" diff --git a/sdk/src/metrics/export/periodic_exporting_metric_reader.cc b/sdk/src/metrics/export/periodic_exporting_metric_reader.cc index 1de1ea71c8..f6ae47977d 100644 --- a/sdk/src/metrics/export/periodic_exporting_metric_reader.cc +++ b/sdk/src/metrics/export/periodic_exporting_metric_reader.cc @@ -1,12 +1,27 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" -#include "opentelemetry/common/spin_lock_mutex.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" +#include "opentelemetry/version.h" -#include #if defined(_MSC_VER) # pragma warning(suppress : 5204) # include diff --git a/sdk/src/metrics/export/periodic_exporting_metric_reader_factory.cc b/sdk/src/metrics/export/periodic_exporting_metric_reader_factory.cc index c4f0b8348a..6c85caaa2a 100644 --- a/sdk/src/metrics/export/periodic_exporting_metric_reader_factory.cc +++ b/sdk/src/metrics/export/periodic_exporting_metric_reader_factory.cc @@ -1,8 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h" +#include +#include + #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_factory.h" +#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h" +#include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/version.h" diff --git a/sdk/src/metrics/instrument_metadata_validator.cc b/sdk/src/metrics/instrument_metadata_validator.cc index 0b00404447..a63050985e 100644 --- a/sdk/src/metrics/instrument_metadata_validator.cc +++ b/sdk/src/metrics/instrument_metadata_validator.cc @@ -1,12 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/instrument_metadata_validator.h" -#include "opentelemetry/common/macros.h" -#include "opentelemetry/nostd/string_view.h" +#include +#include +#include +#include -#include -#include +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/metrics/instrument_metadata_validator.h" +#include "opentelemetry/version.h" #if OPENTELEMETRY_HAVE_WORKING_REGEX # include diff --git a/sdk/src/metrics/meter.cc b/sdk/src/metrics/meter.cc index 763cdcbe02..f472ac726e 100644 --- a/sdk/src/metrics/meter.cc +++ b/sdk/src/metrics/meter.cc @@ -1,27 +1,46 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include #include - +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/metrics/async_instruments.h" #include "opentelemetry/metrics/noop.h" +#include "opentelemetry/metrics/observer_result.h" +#include "opentelemetry/metrics/sync_instruments.h" #include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/attributemap_hash.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/metrics/async_instruments.h" - -#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW -# include "opentelemetry/sdk/metrics/exemplar/reservoir_utils.h" -#endif - +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/meter.h" +#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/state/async_metric_storage.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" +#include "opentelemetry/sdk/metrics/state/metric_storage.h" #include "opentelemetry/sdk/metrics/state/multi_metric_storage.h" #include "opentelemetry/sdk/metrics/state/observable_registry.h" #include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/sync_instruments.h" -#include "opentelemetry/sdk_config.h" +#include "opentelemetry/sdk/metrics/view/view.h" +#include "opentelemetry/sdk/metrics/view/view_registry.h" +#include "opentelemetry/version.h" -#include +#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW +# include "opentelemetry/sdk/metrics/exemplar/reservoir_utils.h" +#endif OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk @@ -30,7 +49,6 @@ namespace metrics { namespace metrics = opentelemetry::metrics; -namespace nostd = opentelemetry::nostd; Meter::Meter( std::weak_ptr meter_context, @@ -40,38 +58,38 @@ Meter::Meter( observable_registry_(new ObservableRegistry()) {} -nostd::unique_ptr> Meter::CreateUInt64Counter( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::unique_ptr> Meter::CreateUInt64Counter( + opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { OTEL_INTERNAL_LOG_ERROR("Meter::CreateUInt64Counter - failed. Invalid parameters." << name << " " << description << " " << unit << ". Measurements won't be recorded."); - return nostd::unique_ptr>( + return opentelemetry::nostd::unique_ptr>( new metrics::NoopCounter(name, description, unit)); } InstrumentDescriptor instrument_descriptor = { std::string{name.data(), name.size()}, std::string{description.data(), description.size()}, std::string{unit.data(), unit.size()}, InstrumentType::kCounter, InstrumentValueType::kLong}; auto storage = RegisterSyncMetricStorage(instrument_descriptor); - return nostd::unique_ptr>( + return opentelemetry::nostd::unique_ptr>( new LongCounter(instrument_descriptor, std::move(storage))); } -nostd::unique_ptr> Meter::CreateDoubleCounter( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::unique_ptr> Meter::CreateDoubleCounter( + opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { OTEL_INTERNAL_LOG_ERROR("Meter::CreateDoubleCounter - failed. Invalid parameters." << name << " " << description << " " << unit << ". Measurements won't be recorded."); - return nostd::unique_ptr>( + return opentelemetry::nostd::unique_ptr>( new metrics::NoopCounter(name, description, unit)); } InstrumentDescriptor instrument_descriptor = { @@ -79,14 +97,14 @@ nostd::unique_ptr> Meter::CreateDoubleCounter( std::string{unit.data(), unit.size()}, InstrumentType::kCounter, InstrumentValueType::kDouble}; auto storage = RegisterSyncMetricStorage(instrument_descriptor); - return nostd::unique_ptr>{ + return opentelemetry::nostd::unique_ptr>{ new DoubleCounter(instrument_descriptor, std::move(storage))}; } -nostd::shared_ptr Meter::CreateInt64ObservableCounter( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::shared_ptr +Meter::CreateInt64ObservableCounter(opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { @@ -100,14 +118,14 @@ nostd::shared_ptr Meter::CreateInt std::string{unit.data(), unit.size()}, InstrumentType::kObservableCounter, InstrumentValueType::kLong}; auto storage = RegisterAsyncMetricStorage(instrument_descriptor); - return nostd::shared_ptr{ + return opentelemetry::nostd::shared_ptr{ new ObservableInstrument(instrument_descriptor, std::move(storage), observable_registry_)}; } -nostd::shared_ptr -Meter::CreateDoubleObservableCounter(nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::shared_ptr +Meter::CreateDoubleObservableCounter(opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { @@ -121,21 +139,21 @@ Meter::CreateDoubleObservableCounter(nostd::string_view name, std::string{unit.data(), unit.size()}, InstrumentType::kObservableCounter, InstrumentValueType::kDouble}; auto storage = RegisterAsyncMetricStorage(instrument_descriptor); - return nostd::shared_ptr{ + return opentelemetry::nostd::shared_ptr{ new ObservableInstrument(instrument_descriptor, std::move(storage), observable_registry_)}; } -nostd::unique_ptr> Meter::CreateUInt64Histogram( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::unique_ptr> Meter::CreateUInt64Histogram( + opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { OTEL_INTERNAL_LOG_ERROR("Meter::CreateUInt64Histogram - failed. Invalid parameters." << name << " " << description << " " << unit << ". Measurements won't be recorded."); - return nostd::unique_ptr>( + return opentelemetry::nostd::unique_ptr>( new metrics::NoopHistogram(name, description, unit)); } InstrumentDescriptor instrument_descriptor = { @@ -143,21 +161,21 @@ nostd::unique_ptr> Meter::CreateUInt64Histogram( std::string{unit.data(), unit.size()}, InstrumentType::kHistogram, InstrumentValueType::kLong}; auto storage = RegisterSyncMetricStorage(instrument_descriptor); - return nostd::unique_ptr>{ + return opentelemetry::nostd::unique_ptr>{ new LongHistogram(instrument_descriptor, std::move(storage))}; } -nostd::unique_ptr> Meter::CreateDoubleHistogram( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::unique_ptr> Meter::CreateDoubleHistogram( + opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { OTEL_INTERNAL_LOG_ERROR("Meter::CreateDoubleHistogram - failed. Invalid parameters." << name << " " << description << " " << unit << ". Measurements won't be recorded."); - return nostd::unique_ptr>( + return opentelemetry::nostd::unique_ptr>( new metrics::NoopHistogram(name, description, unit)); } InstrumentDescriptor instrument_descriptor = { @@ -165,14 +183,14 @@ nostd::unique_ptr> Meter::CreateDoubleHistogram( std::string{unit.data(), unit.size()}, InstrumentType::kHistogram, InstrumentValueType::kDouble}; auto storage = RegisterSyncMetricStorage(instrument_descriptor); - return nostd::unique_ptr>{ + return opentelemetry::nostd::unique_ptr>{ new DoubleHistogram(instrument_descriptor, std::move(storage))}; } -nostd::shared_ptr Meter::CreateInt64ObservableGauge( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::shared_ptr +Meter::CreateInt64ObservableGauge(opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { @@ -186,14 +204,14 @@ nostd::shared_ptr Meter::CreateInt std::string{unit.data(), unit.size()}, InstrumentType::kObservableGauge, InstrumentValueType::kLong}; auto storage = RegisterAsyncMetricStorage(instrument_descriptor); - return nostd::shared_ptr{ + return opentelemetry::nostd::shared_ptr{ new ObservableInstrument(instrument_descriptor, std::move(storage), observable_registry_)}; } -nostd::shared_ptr Meter::CreateDoubleObservableGauge( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::shared_ptr +Meter::CreateDoubleObservableGauge(opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { @@ -207,21 +225,21 @@ nostd::shared_ptr Meter::CreateDou std::string{unit.data(), unit.size()}, InstrumentType::kObservableGauge, InstrumentValueType::kDouble}; auto storage = RegisterAsyncMetricStorage(instrument_descriptor); - return nostd::shared_ptr{ + return opentelemetry::nostd::shared_ptr{ new ObservableInstrument(instrument_descriptor, std::move(storage), observable_registry_)}; } -nostd::unique_ptr> Meter::CreateInt64UpDownCounter( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::unique_ptr> Meter::CreateInt64UpDownCounter( + opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { OTEL_INTERNAL_LOG_ERROR("Meter::CreateInt64UpDownCounter - failed. Invalid parameters." << name << " " << description << " " << unit << ". Measurements won't be recorded."); - return nostd::unique_ptr>( + return opentelemetry::nostd::unique_ptr>( new metrics::NoopUpDownCounter(name, description, unit)); } InstrumentDescriptor instrument_descriptor = { @@ -229,21 +247,21 @@ nostd::unique_ptr> Meter::CreateInt64UpDownCount std::string{unit.data(), unit.size()}, InstrumentType::kUpDownCounter, InstrumentValueType::kLong}; auto storage = RegisterSyncMetricStorage(instrument_descriptor); - return nostd::unique_ptr>{ + return opentelemetry::nostd::unique_ptr>{ new LongUpDownCounter(instrument_descriptor, std::move(storage))}; } -nostd::unique_ptr> Meter::CreateDoubleUpDownCounter( - nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::unique_ptr> Meter::CreateDoubleUpDownCounter( + opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { OTEL_INTERNAL_LOG_ERROR("Meter::CreateDoubleUpDownCounter - failed. Invalid parameters." << name << " " << description << " " << unit << ". Measurements won't be recorded."); - return nostd::unique_ptr>( + return opentelemetry::nostd::unique_ptr>( new metrics::NoopUpDownCounter(name, description, unit)); } InstrumentDescriptor instrument_descriptor = { @@ -251,14 +269,14 @@ nostd::unique_ptr> Meter::CreateDoubleUpDownCount std::string{unit.data(), unit.size()}, InstrumentType::kUpDownCounter, InstrumentValueType::kDouble}; auto storage = RegisterSyncMetricStorage(instrument_descriptor); - return nostd::unique_ptr>{ + return opentelemetry::nostd::unique_ptr>{ new DoubleUpDownCounter(instrument_descriptor, std::move(storage))}; } -nostd::shared_ptr -Meter::CreateInt64ObservableUpDownCounter(nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::shared_ptr +Meter::CreateInt64ObservableUpDownCounter(opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { @@ -272,14 +290,14 @@ Meter::CreateInt64ObservableUpDownCounter(nostd::string_view name, std::string{unit.data(), unit.size()}, InstrumentType::kObservableUpDownCounter, InstrumentValueType::kLong}; auto storage = RegisterAsyncMetricStorage(instrument_descriptor); - return nostd::shared_ptr{ + return opentelemetry::nostd::shared_ptr{ new ObservableInstrument(instrument_descriptor, std::move(storage), observable_registry_)}; } -nostd::shared_ptr -Meter::CreateDoubleObservableUpDownCounter(nostd::string_view name, - nostd::string_view description, - nostd::string_view unit) noexcept +opentelemetry::nostd::shared_ptr +Meter::CreateDoubleObservableUpDownCounter(opentelemetry::nostd::string_view name, + opentelemetry::nostd::string_view description, + opentelemetry::nostd::string_view unit) noexcept { if (!ValidateInstrument(name, description, unit)) { @@ -293,7 +311,7 @@ Meter::CreateDoubleObservableUpDownCounter(nostd::string_view name, std::string{unit.data(), unit.size()}, InstrumentType::kObservableUpDownCounter, InstrumentValueType::kDouble}; auto storage = RegisterAsyncMetricStorage(instrument_descriptor); - return nostd::shared_ptr{ + return opentelemetry::nostd::shared_ptr{ new ObservableInstrument(instrument_descriptor, std::move(storage), observable_registry_)}; } diff --git a/sdk/src/metrics/meter_context.cc b/sdk/src/metrics/meter_context.cc index 2b5ef3148c..de32c469d8 100644 --- a/sdk/src/metrics/meter_context.cc +++ b/sdk/src/metrics/meter_context.cc @@ -1,14 +1,33 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/meter_context.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/span.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/metrics/meter.h" +#include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/metrics/state/metric_collector.h" -#include "opentelemetry/sdk_config.h" - -#include +#include "opentelemetry/sdk/metrics/view/instrument_selector.h" +#include "opentelemetry/sdk/metrics/view/meter_selector.h" +#include "opentelemetry/sdk/metrics/view/view.h" +#include "opentelemetry/sdk/metrics/view/view_registry.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/meter_context_factory.cc b/sdk/src/metrics/meter_context_factory.cc index d41bb6a193..59e97ce264 100644 --- a/sdk/src/metrics/meter_context_factory.cc +++ b/sdk/src/metrics/meter_context_factory.cc @@ -1,10 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/meter_context_factory.h" +#include +#include + #include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/sdk/metrics/meter_context_factory.h" +#include "opentelemetry/sdk/metrics/view/view_registry.h" #include "opentelemetry/sdk/metrics/view/view_registry_factory.h" - +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/metrics/meter_provider.cc b/sdk/src/metrics/meter_provider.cc index 84a0f56bf4..959ff32800 100644 --- a/sdk/src/metrics/meter_provider.cc +++ b/sdk/src/metrics/meter_provider.cc @@ -1,18 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include #include #include #include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/metrics/meter.h" +#include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/span.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/metrics/export/metric_producer.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/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" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/metrics/metric_reader.cc b/sdk/src/metrics/metric_reader.cc index 8046b1c148..e2f5bc1f1c 100644 --- a/sdk/src/metrics/metric_reader.cc +++ b/sdk/src/metrics/metric_reader.cc @@ -4,8 +4,7 @@ #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/export/metric_producer.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/state/metric_collector.cc b/sdk/src/metrics/state/metric_collector.cc index f0535a905d..5ecf41cecf 100644 --- a/sdk/src/metrics/state/metric_collector.cc +++ b/sdk/src/metrics/state/metric_collector.cc @@ -1,12 +1,22 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/state/metric_collector.h" +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/meter.h" #include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/metrics/metric_reader.h" -#include "opentelemetry/sdk_config.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/metrics/state/observable_registry.cc b/sdk/src/metrics/state/observable_registry.cc index 86a6d17abd..4da46ddfe3 100644 --- a/sdk/src/metrics/state/observable_registry.cc +++ b/sdk/src/metrics/state/observable_registry.cc @@ -1,11 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/state/observable_registry.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/metrics/async_instruments.h" +#include "opentelemetry/metrics/observer_result.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/variant.h" +#include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/async_instruments.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/observer_result.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" -#include "opentelemetry/sdk_config.h" +#include "opentelemetry/sdk/metrics/state/observable_registry.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/state/sync_metric_storage.cc b/sdk/src/metrics/state/sync_metric_storage.cc index 72bee72ea5..fe736e64f3 100644 --- a/sdk/src/metrics/state/sync_metric_storage.cc +++ b/sdk/src/metrics/state/sync_metric_storage.cc @@ -1,7 +1,20 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include + +#include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" #include "opentelemetry/sdk/metrics/state/sync_metric_storage.h" +#include "opentelemetry/sdk/metrics/state/temporal_metric_storage.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/state/temporal_metric_storage.cc b/sdk/src/metrics/state/temporal_metric_storage.cc index f988551108..2ba74d9213 100644 --- a/sdk/src/metrics/state/temporal_metric_storage.cc +++ b/sdk/src/metrics/state/temporal_metric_storage.cc @@ -1,16 +1,30 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/state/temporal_metric_storage.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "opentelemetry/common/spin_lock_mutex.h" -#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/span.h" +#include "opentelemetry/sdk/common/attributemap_hash.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" #include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" +#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" #include "opentelemetry/sdk/metrics/state/metric_collector.h" - -#include -#include -#include +#include "opentelemetry/sdk/metrics/state/temporal_metric_storage.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/sync_instruments.cc b/sdk/src/metrics/sync_instruments.cc index bdeff150ae..a99fa80868 100644 --- a/sdk/src/metrics/sync_instruments.cc +++ b/sdk/src/metrics/sync_instruments.cc @@ -1,9 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/context/context.h" +#include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/state/metric_storage.h" #include "opentelemetry/sdk/metrics/sync_instruments.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/view/view_factory.cc b/sdk/src/metrics/view/view_factory.cc index 24d87769f9..36496f62d6 100644 --- a/sdk/src/metrics/view/view_factory.cc +++ b/sdk/src/metrics/view/view_factory.cc @@ -1,8 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include "opentelemetry/sdk/metrics/view/view_factory.h" +#include +#include +#include + +#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/sdk/metrics/view/attributes_processor.h" #include "opentelemetry/sdk/metrics/view/view.h" +#include "opentelemetry/sdk/metrics/view/view_factory.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/trace/batch_span_processor.cc b/sdk/src/trace/batch_span_processor.cc index 7759949490..c5e72f8176 100644 --- a/sdk/src/trace/batch_span_processor.cc +++ b/sdk/src/trace/batch_span_processor.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include #include #include #include @@ -13,7 +14,6 @@ #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"