From 18186c32892f87fefbe37b7a1c52ad0cdbf26ee5 Mon Sep 17 00:00:00 2001 From: Cengizhan Pasaoglu Date: Tue, 6 Jun 2023 13:14:21 +0200 Subject: [PATCH 1/2] First draft of forward declaration applied in SDK folder --- .../trace/span_context_kv_iterable_view.h | 2 + examples/batch/main.cc | 4 ++ examples/grpc/tracer_common.h | 3 + examples/http/tracer_common.h | 3 + examples/jaeger/main.cc | 1 + examples/logs_simple/main.cc | 3 + examples/multithreaded/main.cc | 2 + examples/otlp/grpc_log_main.cc | 2 + examples/otlp/grpc_main.cc | 1 + examples/otlp/http_log_main.cc | 2 + examples/otlp/http_main.cc | 1 + examples/simple/main.cc | 2 + examples/zipkin/main.cc | 2 + .../elasticsearch/src/es_log_recordable.cc | 6 ++ .../opentelemetry/exporters/etw/etw_tracer.h | 1 + exporters/jaeger/src/recordable.cc | 1 + exporters/jaeger/test/jaeger_exporter_test.cc | 10 +++- .../exporters/ostream/log_record_exporter.h | 3 + .../exporters/ostream/metric_exporter.h | 10 ++++ exporters/ostream/src/log_record_exporter.cc | 2 + exporters/ostream/src/metric_exporter.cc | 12 ++-- exporters/ostream/test/ostream_log_test.cc | 5 +- exporters/ostream/test/ostream_metric_test.cc | 14 +++-- exporters/otlp/src/otlp_metric_utils.cc | 1 + .../otlp_grpc_log_record_exporter_test.cc | 2 + .../otlp/test/otlp_http_exporter_test.cc | 1 + .../test/otlp_http_metric_exporter_test.cc | 2 + exporters/otlp/test/otlp_recordable_test.cc | 1 + exporters/zipkin/src/recordable.cc | 1 + exporters/zipkin/test/zipkin_exporter_test.cc | 4 +- ext/test/w3c_tracecontext_test/main.cc | 1 + functional/otlp/func_http_main.cc | 2 + .../sdk/common/atomic_shared_ptr.h | 1 + .../sdk/common/attribute_utils.h | 2 + .../sdk/common/attributemap_hash.h | 7 ++- .../sdk/common/circular_buffer.h | 1 + .../sdk/common/circular_buffer_range.h | 2 - .../sdk/common/empty_attributes.h | 8 +-- .../sdk/common/global_log_handler.h | 1 - .../instrumentation_library.h | 1 + .../instrumentation_scope.h | 8 +-- .../sdk/logs/batch_log_record_processor.h | 1 + .../logs/batch_log_record_processor_factory.h | 8 ++- .../logs/batch_log_record_processor_options.h | 4 +- .../opentelemetry/sdk/logs/event_logger.h | 10 ++-- .../sdk/logs/event_logger_provider.h | 5 +- .../sdk/logs/event_logger_provider_factory.h | 9 ++- sdk/include/opentelemetry/sdk/logs/exporter.h | 7 ++- sdk/include/opentelemetry/sdk/logs/logger.h | 5 +- .../opentelemetry/sdk/logs/logger_context.h | 5 +- .../sdk/logs/logger_context_factory.h | 11 +++- .../opentelemetry/sdk/logs/logger_provider.h | 11 ++-- .../sdk/logs/logger_provider_factory.h | 19 +++++-- .../sdk/logs/multi_log_record_processor.h | 4 +- .../logs/multi_log_record_processor_factory.h | 3 +- .../opentelemetry/sdk/logs/multi_recordable.h | 3 +- .../opentelemetry/sdk/logs/processor.h | 5 +- .../sdk/logs/read_write_log_record.h | 5 +- .../sdk/logs/readable_log_record.h | 26 ++++++--- .../opentelemetry/sdk/logs/recordable.h | 22 ++++---- .../sdk/logs/simple_log_record_processor.h | 7 ++- .../simple_log_record_processor_factory.h | 5 +- .../sdk/metrics/aggregation/aggregation.h | 6 +- .../metrics/aggregation/aggregation_config.h | 4 +- .../metrics/aggregation/default_aggregation.h | 7 +-- .../metrics/aggregation/drop_aggregation.h | 7 ++- .../aggregation/histogram_aggregation.h | 8 ++- .../aggregation/lastvalue_aggregation.h | 6 +- .../sdk/metrics/aggregation/sum_aggregation.h | 6 +- .../sdk/metrics/async_instruments.h | 6 +- .../sdk/metrics/data/exemplar_data.h | 3 +- .../sdk/metrics/data/metric_data.h | 4 +- .../sdk/metrics/data/point_data.h | 5 +- .../metrics/exemplar/always_sample_filter.h | 6 ++ .../sdk/metrics/exemplar/filter.h | 14 ++++- .../exemplar/filtered_exemplar_reservoir.h | 15 ++++- .../exemplar/fixed_size_exemplar_reservoir.h | 1 + .../exemplar/histogram_exemplar_reservoir.h | 15 ++++- .../metrics/exemplar/never_sample_filter.h | 6 ++ .../metrics/exemplar/no_exemplar_reservoir.h | 19 ++++++- .../sdk/metrics/exemplar/reservoir.h | 16 +++++- .../sdk/metrics/exemplar/reservoir_cell.h | 12 ++-- .../exemplar/reservoir_cell_selector.h | 12 ++-- .../exemplar/with_trace_sample_filter.h | 1 + .../sdk/metrics/export/metric_producer.h | 16 +++++- .../export/periodic_exporting_metric_reader.h | 8 ++- .../metrics/instrument_metadata_validator.h | 1 + .../opentelemetry/sdk/metrics/instruments.h | 4 +- sdk/include/opentelemetry/sdk/metrics/meter.h | 11 +++- .../opentelemetry/sdk/metrics/meter_context.h | 18 +++--- .../sdk/metrics/meter_provider.h | 18 ++++-- .../opentelemetry/sdk/metrics/metric_reader.h | 11 ++-- .../sdk/metrics/observer_result.h | 5 +- .../sdk/metrics/push_metric_exporter.h | 11 ++-- .../sdk/metrics/state/async_metric_storage.h | 6 +- .../sdk/metrics/state/metric_collector.h | 6 +- .../sdk/metrics/state/metric_storage.h | 18 +++++- .../sdk/metrics/state/multi_metric_storage.h | 19 ++++++- .../sdk/metrics/state/observable_registry.h | 7 ++- .../sdk/metrics/state/sync_metric_storage.h | 16 ++++-- .../metrics/state/temporal_metric_storage.h | 17 ++++-- .../sdk/metrics/sync_instruments.h | 7 +-- .../sdk/metrics/view/attributes_processor.h | 7 +++ .../sdk/metrics/view/instrument_selector.h | 4 ++ .../sdk/metrics/view/meter_selector.h | 3 + .../sdk/metrics/view/predicate_factory.h | 3 + .../opentelemetry/sdk/metrics/view/view.h | 7 ++- .../sdk/metrics/view/view_registry.h | 5 ++ .../opentelemetry/sdk/resource/resource.h | 9 +-- .../sdk/resource/resource_detector.h | 4 +- .../sdk/trace/batch_span_processor.h | 14 +++-- .../sdk/trace/batch_span_processor_factory.h | 8 +-- .../sdk/trace/batch_span_processor_options.h | 4 +- .../opentelemetry/sdk/trace/exporter.h | 9 ++- .../opentelemetry/sdk/trace/id_generator.h | 1 + .../sdk/trace/multi_recordable.h | 4 +- .../sdk/trace/multi_span_processor.h | 5 +- .../opentelemetry/sdk/trace/processor.h | 10 +++- .../sdk/trace/random_id_generator.h | 2 + .../sdk/trace/random_id_generator_factory.h | 3 +- .../opentelemetry/sdk/trace/recordable.h | 20 ++++--- sdk/include/opentelemetry/sdk/trace/sampler.h | 27 ++++++--- .../sdk/trace/samplers/always_off.h | 5 ++ .../sdk/trace/samplers/always_off_factory.h | 3 +- .../sdk/trace/samplers/always_on.h | 15 +++++ .../sdk/trace/samplers/always_on_factory.h | 3 +- .../opentelemetry/sdk/trace/samplers/parent.h | 17 +++++- .../sdk/trace/samplers/parent_factory.h | 3 +- .../sdk/trace/samplers/trace_id_ratio.h | 18 ++++++ .../trace/samplers/trace_id_ratio_factory.h | 3 +- .../sdk/trace/simple_processor.h | 5 ++ .../sdk/trace/simple_processor_factory.h | 5 +- .../opentelemetry/sdk/trace/span_data.h | 9 ++- sdk/include/opentelemetry/sdk/trace/tracer.h | 30 ++++++---- .../opentelemetry/sdk/trace/tracer_context.h | 5 +- .../sdk/trace/tracer_context_factory.h | 15 ++++- .../opentelemetry/sdk/trace/tracer_provider.h | 26 +++++---- .../sdk/trace/tracer_provider_factory.h | 21 +++++-- sdk/src/common/global_log_handler.cc | 3 +- sdk/src/logs/batch_log_record_processor.cc | 4 ++ sdk/src/logs/logger.cc | 9 ++- sdk/src/logs/logger_context_factory.cc | 3 + sdk/src/logs/logger_provider.cc | 10 ++-- sdk/src/logs/multi_log_record_processor.cc | 6 +- sdk/src/logs/readable_log_record.cc | 7 ++- sdk/src/logs/simple_log_record_processor.cc | 7 ++- .../aggregation/histogram_aggregation.cc | 1 + sdk/src/metrics/async_instruments.cc | 3 +- sdk/src/metrics/meter_context.cc | 4 +- sdk/src/metrics/meter_provider.cc | 2 + sdk/src/metrics/metric_reader.cc | 1 + .../metrics/state/temporal_metric_storage.cc | 14 +++-- sdk/src/resource/resource.cc | 1 + sdk/src/resource/resource_detector.cc | 3 + sdk/src/trace/batch_span_processor.cc | 5 ++ sdk/src/trace/samplers/parent.cc | 1 + sdk/src/trace/span.cc | 14 +++-- sdk/src/trace/tracer.cc | 55 ++++++++++--------- sdk/src/trace/tracer_provider.cc | 3 + sdk/src/trace/tracer_provider_factory.cc | 1 + sdk/test/logs/log_record_test.cc | 1 + sdk/test/logs/logger_provider_sdk_test.cc | 1 + sdk/test/logs/logger_sdk_test.cc | 6 +- sdk/test/metrics/aggregation_test.cc | 1 + sdk/test/metrics/async_instruments_test.cc | 1 + .../metrics/attributes_hashmap_benchmark.cc | 2 + .../exemplar/always_sample_filter_test.cc | 2 + sdk/test/metrics/multi_metric_storage_test.cc | 1 - sdk/test/resource/resource_test.cc | 5 +- sdk/test/trace/batch_span_processor_test.cc | 4 ++ sdk/test/trace/sampler_benchmark.cc | 8 ++- sdk/test/trace/tracer_test.cc | 5 +- 172 files changed, 856 insertions(+), 361 deletions(-) diff --git a/api/include/opentelemetry/trace/span_context_kv_iterable_view.h b/api/include/opentelemetry/trace/span_context_kv_iterable_view.h index c20155edd6..6a21aaf54a 100644 --- a/api/include/opentelemetry/trace/span_context_kv_iterable_view.h +++ b/api/include/opentelemetry/trace/span_context_kv_iterable_view.h @@ -9,8 +9,10 @@ #include "opentelemetry/common/key_value_iterable_view.h" #include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/span.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/nostd/utility.h" +#include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_context_kv_iterable.h" #include "opentelemetry/version.h" diff --git a/examples/batch/main.cc b/examples/batch/main.cc index a417933247..0e05c1b700 100644 --- a/examples/batch/main.cc +++ b/examples/batch/main.cc @@ -2,7 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/ostream/span_exporter_factory.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/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" diff --git a/examples/grpc/tracer_common.h b/examples/grpc/tracer_common.h index 073bffd50a..347e7a8184 100644 --- a/examples/grpc/tracer_common.h +++ b/examples/grpc/tracer_common.h @@ -7,7 +7,10 @@ #include "opentelemetry/context/propagation/text_map_propagator.h" #include "opentelemetry/exporters/ostream/span_exporter_factory.h" #include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" +#include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/sdk/trace/tracer_context_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/propagation/http_trace_context.h" diff --git a/examples/http/tracer_common.h b/examples/http/tracer_common.h index 0b74d2ff8e..7d9f1ca571 100644 --- a/examples/http/tracer_common.h +++ b/examples/http/tracer_common.h @@ -4,7 +4,10 @@ #pragma once #include "opentelemetry/exporters/ostream/span_exporter_factory.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" +#include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/sdk/trace/tracer_context_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" diff --git a/examples/jaeger/main.cc b/examples/jaeger/main.cc index faa9758f02..1b60eaed2a 100644 --- a/examples/jaeger/main.cc +++ b/examples/jaeger/main.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/jaeger/jaeger_exporter_factory.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" diff --git a/examples/logs_simple/main.cc b/examples/logs_simple/main.cc index f4bcecbb39..c12733d4c3 100644 --- a/examples/logs_simple/main.cc +++ b/examples/logs_simple/main.cc @@ -3,6 +3,8 @@ #ifdef ENABLE_LOGS_PREVIEW # include "opentelemetry/exporters/ostream/span_exporter_factory.h" +# include "opentelemetry/sdk/trace/exporter.h" +# include "opentelemetry/sdk/trace/processor.h" # include "opentelemetry/sdk/trace/simple_processor_factory.h" # include "opentelemetry/sdk/trace/tracer_provider_factory.h" # include "opentelemetry/trace/provider.h" @@ -10,6 +12,7 @@ # include "opentelemetry/exporters/ostream/log_record_exporter.h" # include "opentelemetry/logs/provider.h" # include "opentelemetry/sdk/logs/logger_provider_factory.h" +# include "opentelemetry/sdk/logs/processor.h" # include "opentelemetry/sdk/logs/simple_log_record_processor_factory.h" # ifdef BAZEL_BUILD diff --git a/examples/multithreaded/main.cc b/examples/multithreaded/main.cc index 49eaf4d16d..6071e2597a 100644 --- a/examples/multithreaded/main.cc +++ b/examples/multithreaded/main.cc @@ -3,6 +3,8 @@ #include "opentelemetry/exporters/ostream/span_exporter_factory.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" diff --git a/examples/otlp/grpc_log_main.cc b/examples/otlp/grpc_log_main.cc index e0c85c38c2..ffd4376ebf 100644 --- a/examples/otlp/grpc_log_main.cc +++ b/examples/otlp/grpc_log_main.cc @@ -6,7 +6,9 @@ # include "opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_factory.h" # include "opentelemetry/logs/provider.h" # include "opentelemetry/sdk/logs/logger_provider_factory.h" +# include "opentelemetry/sdk/logs/processor.h" # include "opentelemetry/sdk/logs/simple_log_record_processor_factory.h" +# include "opentelemetry/sdk/trace/processor.h" # include "opentelemetry/sdk/trace/simple_processor_factory.h" # include "opentelemetry/sdk/trace/tracer_provider_factory.h" # include "opentelemetry/trace/provider.h" diff --git a/examples/otlp/grpc_main.cc b/examples/otlp/grpc_main.cc index d7e3b29d6c..c238d9ad2a 100644 --- a/examples/otlp/grpc_main.cc +++ b/examples/otlp/grpc_main.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" diff --git a/examples/otlp/http_log_main.cc b/examples/otlp/http_log_main.cc index a1171b04e0..5a5eeb599a 100644 --- a/examples/otlp/http_log_main.cc +++ b/examples/otlp/http_log_main.cc @@ -8,7 +8,9 @@ # include "opentelemetry/logs/provider.h" # include "opentelemetry/sdk/common/global_log_handler.h" # include "opentelemetry/sdk/logs/logger_provider_factory.h" +# include "opentelemetry/sdk/logs/processor.h" # include "opentelemetry/sdk/logs/simple_log_record_processor_factory.h" +# include "opentelemetry/sdk/trace/processor.h" # include "opentelemetry/sdk/trace/simple_processor_factory.h" # include "opentelemetry/sdk/trace/tracer_provider_factory.h" # include "opentelemetry/trace/provider.h" diff --git a/examples/otlp/http_main.cc b/examples/otlp/http_main.cc index 09b8daeee2..6a0667b918 100644 --- a/examples/otlp/http_main.cc +++ b/examples/otlp/http_main.cc @@ -4,6 +4,7 @@ #include "opentelemetry/exporters/otlp/otlp_http_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" diff --git a/examples/simple/main.cc b/examples/simple/main.cc index 6a8b28e4dd..48768b6448 100644 --- a/examples/simple/main.cc +++ b/examples/simple/main.cc @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/ostream/span_exporter_factory.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" diff --git a/examples/zipkin/main.cc b/examples/zipkin/main.cc index 6788d8cabe..0052cd430e 100644 --- a/examples/zipkin/main.cc +++ b/examples/zipkin/main.cc @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/zipkin/zipkin_exporter_factory.h" +#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" diff --git a/exporters/elasticsearch/src/es_log_recordable.cc b/exporters/elasticsearch/src/es_log_recordable.cc index 03c6c640e5..e3f60be0a9 100644 --- a/exporters/elasticsearch/src/es_log_recordable.cc +++ b/exporters/elasticsearch/src/es_log_recordable.cc @@ -4,6 +4,12 @@ #ifdef ENABLE_LOGS_PREVIEW # include "opentelemetry/exporters/elasticsearch/es_log_recordable.h" +# include "opentelemetry/logs/severity.h" +# include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.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" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h b/exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h index 039351f66e..6601f850df 100644 --- a/exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h +++ b/exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h @@ -32,6 +32,7 @@ #include "opentelemetry/trace/trace_id.h" #include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/sdk/common/empty_attributes.h" #include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" diff --git a/exporters/jaeger/src/recordable.cc b/exporters/jaeger/src/recordable.cc index d147d96553..1fd7e99dff 100644 --- a/exporters/jaeger/src/recordable.cc +++ b/exporters/jaeger/src/recordable.cc @@ -3,6 +3,7 @@ #include "opentelemetry/exporters/jaeger/recordable.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/jaeger/test/jaeger_exporter_test.cc b/exporters/jaeger/test/jaeger_exporter_test.cc index 7f86f877bc..ea305267c5 100644 --- a/exporters/jaeger/test/jaeger_exporter_test.cc +++ b/exporters/jaeger/test/jaeger_exporter_test.cc @@ -1,11 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include -#include -#include +#include "opentelemetry/exporters/jaeger/jaeger_exporter.h" #include "opentelemetry/sdk/trace/batch_span_processor.h" +#include "opentelemetry/sdk/trace/batch_span_processor_options.h" +#include "opentelemetry/sdk/trace/tracer.h" #include "opentelemetry/sdk/trace/tracer_provider.h" +#include "opentelemetry/trace/span_startoptions.h" #ifdef BAZEL_BUILD # include "exporters/jaeger/src/thrift_sender.h" @@ -16,6 +17,9 @@ #include #include "gmock/gmock.h" +#include +#include + namespace trace = opentelemetry::trace; namespace nostd = opentelemetry::nostd; namespace sdktrace = opentelemetry::sdk::trace; 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 34806bd200..54dae898d2 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/log_record_exporter.h @@ -4,14 +4,17 @@ #pragma once #ifdef ENABLE_LOGS_PREVIEW +# include "opentelemetry/common/attribute_value.h" # include "opentelemetry/common/spin_lock_mutex.h" # include "opentelemetry/nostd/type_traits.h" +# include "opentelemetry/sdk/common/attribute_utils.h" # include "opentelemetry/sdk/logs/exporter.h" # include "opentelemetry/version.h" # include # include +# include OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h b/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h index 36e5917457..92419fdea0 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h @@ -5,13 +5,23 @@ #include #include + #include "opentelemetry/common/spin_lock_mutex.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/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace sdk +{ +namespace resource +{ +class Resource; +} // namespace resource +} // namespace sdk + namespace exporter { namespace metrics diff --git a/exporters/ostream/src/log_record_exporter.cc b/exporters/ostream/src/log_record_exporter.cc index 18552d7a65..611a749184 100644 --- a/exporters/ostream/src/log_record_exporter.cc +++ b/exporters/ostream/src/log_record_exporter.cc @@ -4,7 +4,9 @@ #ifdef ENABLE_LOGS_PREVIEW # include "opentelemetry/exporters/ostream/log_record_exporter.h" # include "opentelemetry/exporters/ostream/common_utils.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/sdk_config.h" # include diff --git a/exporters/ostream/src/metric_exporter.cc b/exporters/ostream/src/metric_exporter.cc index d963c4f420..003aaa075f 100644 --- a/exporters/ostream/src/metric_exporter.cc +++ b/exporters/ostream/src/metric_exporter.cc @@ -2,15 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/ostream/metric_exporter.h" -#include -#include -#include -#include #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 + namespace { std::string timeToString(opentelemetry::common::SystemTimestamp time_stamp) diff --git a/exporters/ostream/test/ostream_log_test.cc b/exporters/ostream/test/ostream_log_test.cc index 82bc91a747..92ff3ece76 100644 --- a/exporters/ostream/test/ostream_log_test.cc +++ b/exporters/ostream/test/ostream_log_test.cc @@ -3,15 +3,18 @@ #ifdef ENABLE_LOGS_PREVIEW -# include # include "opentelemetry/exporters/ostream/log_record_exporter.h" # include "opentelemetry/logs/provider.h" # include "opentelemetry/nostd/span.h" +# include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" # include "opentelemetry/sdk/logs/logger_provider.h" # include "opentelemetry/sdk/logs/read_write_log_record.h" # include "opentelemetry/sdk/logs/simple_log_record_processor.h" +# include "opentelemetry/sdk/version/version.h" # include + +# include # include namespace sdklogs = opentelemetry::sdk::logs; diff --git a/exporters/ostream/test/ostream_metric_test.cc b/exporters/ostream/test/ostream_metric_test.cc index cb4a8a3ab4..17fbcb5880 100644 --- a/exporters/ostream/test/ostream_metric_test.cc +++ b/exporters/ostream/test/ostream_metric_test.cc @@ -2,18 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include -#include -#include "opentelemetry/sdk/metrics/instruments.h" -#include "opentelemetry/sdk/resource/resource_detector.h" -#include "opentelemetry/sdk/version/version.h" -#include #include "opentelemetry/exporters/ostream/metric_exporter.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" #include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/sdk/resource/resource_detector.h" +#include "opentelemetry/sdk/version/version.h" + +#include +#include +#include namespace metric_sdk = opentelemetry::sdk::metrics; namespace nostd = opentelemetry::nostd; diff --git a/exporters/otlp/src/otlp_metric_utils.cc b/exporters/otlp/src/otlp_metric_utils.cc index 4f56c2f356..f642bbf85e 100644 --- a/exporters/otlp/src/otlp_metric_utils.cc +++ b/exporters/otlp/src/otlp_metric_utils.cc @@ -3,6 +3,7 @@ #include "opentelemetry/exporters/otlp/otlp_metric_utils.h" #include "opentelemetry/exporters/otlp/otlp_populate_attribute_utils.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc b/exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc index f2962a0b0c..f2ed416327 100644 --- a/exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc +++ b/exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc @@ -19,8 +19,10 @@ # include "opentelemetry/sdk/logs/batch_log_record_processor.h" # include "opentelemetry/sdk/logs/exporter.h" # include "opentelemetry/sdk/logs/logger_provider.h" +# include "opentelemetry/sdk/logs/recordable.h" # include "opentelemetry/sdk/resource/resource.h" # include "opentelemetry/sdk/trace/exporter.h" +# include "opentelemetry/sdk/trace/processor.h" # include "opentelemetry/sdk/trace/simple_processor_factory.h" # include "opentelemetry/sdk/trace/tracer_provider_factory.h" # include "opentelemetry/trace/provider.h" diff --git a/exporters/otlp/test/otlp_http_exporter_test.cc b/exporters/otlp/test/otlp_http_exporter_test.cc index 9c5bfe1766..2ac698b0de 100644 --- a/exporters/otlp/test/otlp_http_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_exporter_test.cc @@ -17,6 +17,7 @@ # include "opentelemetry/ext/http/client/http_client_factory.h" # include "opentelemetry/ext/http/server/http_server.h" # include "opentelemetry/sdk/trace/batch_span_processor.h" +# include "opentelemetry/sdk/trace/batch_span_processor_options.h" # include "opentelemetry/sdk/trace/tracer_provider.h" # include "opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h" # include "opentelemetry/trace/provider.h" diff --git a/exporters/otlp/test/otlp_http_metric_exporter_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_test.cc index c47c86e110..97586b101c 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_test.cc @@ -16,9 +16,11 @@ #include "opentelemetry/common/key_value_iterable_view.h" #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/server/http_server.h" +#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" #include "opentelemetry/sdk/metrics/data/metric_data.h" +#include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h" diff --git a/exporters/otlp/test/otlp_recordable_test.cc b/exporters/otlp/test/otlp_recordable_test.cc index f1b1c73741..4db58844f7 100644 --- a/exporters/otlp/test/otlp_recordable_test.cc +++ b/exporters/otlp/test/otlp_recordable_test.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/otlp/otlp_recordable.h" +#include "opentelemetry/sdk/resource/resource.h" #if defined(__GNUC__) // GCC raises -Wsuggest-override warnings on GTest, diff --git a/exporters/zipkin/src/recordable.cc b/exporters/zipkin/src/recordable.cc index 96b486e51e..3397053e29 100644 --- a/exporters/zipkin/src/recordable.cc +++ b/exporters/zipkin/src/recordable.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/zipkin/recordable.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" #include diff --git a/exporters/zipkin/test/zipkin_exporter_test.cc b/exporters/zipkin/test/zipkin_exporter_test.cc index f8493bec6d..fab19efb65 100644 --- a/exporters/zipkin/test/zipkin_exporter_test.cc +++ b/exporters/zipkin/test/zipkin_exporter_test.cc @@ -4,10 +4,10 @@ #ifndef HAVE_CPP_STDLIB # include "opentelemetry/exporters/zipkin/zipkin_exporter.h" -# include # include "opentelemetry/ext/http/client/curl/http_client_curl.h" # include "opentelemetry/ext/http/server/http_server.h" # include "opentelemetry/sdk/trace/batch_span_processor.h" +# include "opentelemetry/sdk/trace/batch_span_processor_options.h" # include "opentelemetry/sdk/trace/tracer_provider.h" # include "opentelemetry/trace/provider.h" @@ -16,6 +16,8 @@ # include "nlohmann/json.hpp" +# include + # if defined(_MSC_VER) # include "opentelemetry/sdk/common/env_variables.h" using opentelemetry::sdk::common::setenv; diff --git a/ext/test/w3c_tracecontext_test/main.cc b/ext/test/w3c_tracecontext_test/main.cc index 562f45f107..92807dd8ad 100644 --- a/ext/test/w3c_tracecontext_test/main.cc +++ b/ext/test/w3c_tracecontext_test/main.cc @@ -6,6 +6,7 @@ #include "opentelemetry/ext/http/client/curl/http_client_curl.h" #include "opentelemetry/ext/http/server/http_server.h" #include "opentelemetry/sdk/trace/simple_processor.h" +#include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/trace/propagation/http_trace_context.h" #include "opentelemetry/trace/provider.h" diff --git a/functional/otlp/func_http_main.cc b/functional/otlp/func_http_main.cc index 72fbb5e21c..cfe12a2707 100644 --- a/functional/otlp/func_http_main.cc +++ b/functional/otlp/func_http_main.cc @@ -4,10 +4,12 @@ #include "opentelemetry/exporters/otlp/otlp_http_exporter_factory.h" #include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" #include "opentelemetry/trace/provider.h" +#include #include namespace trace = opentelemetry::trace; diff --git a/sdk/include/opentelemetry/sdk/common/atomic_shared_ptr.h b/sdk/include/opentelemetry/sdk/common/atomic_shared_ptr.h index 07e19ac0f8..39c0ce91cc 100644 --- a/sdk/include/opentelemetry/sdk/common/atomic_shared_ptr.h +++ b/sdk/include/opentelemetry/sdk/common/atomic_shared_ptr.h @@ -6,6 +6,7 @@ #include #include #include + #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/common/attribute_utils.h b/sdk/include/opentelemetry/sdk/common/attribute_utils.h index b7839bddc7..c8afd657e2 100644 --- a/sdk/include/opentelemetry/sdk/common/attribute_utils.h +++ b/sdk/include/opentelemetry/sdk/common/attribute_utils.h @@ -7,8 +7,10 @@ #include #include #include + #include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/common/attributemap_hash.h b/sdk/include/opentelemetry/sdk/common/attributemap_hash.h index 086f6b7901..408070255a 100644 --- a/sdk/include/opentelemetry/sdk/common/attributemap_hash.h +++ b/sdk/include/opentelemetry/sdk/common/attributemap_hash.h @@ -3,8 +3,13 @@ #pragma once -#include +#include + +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/common/circular_buffer.h b/sdk/include/opentelemetry/sdk/common/circular_buffer.h index 9f34659352..c2548012b1 100644 --- a/sdk/include/opentelemetry/sdk/common/circular_buffer.h +++ b/sdk/include/opentelemetry/sdk/common/circular_buffer.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include #include diff --git a/sdk/include/opentelemetry/sdk/common/circular_buffer_range.h b/sdk/include/opentelemetry/sdk/common/circular_buffer_range.h index 9ef3b66be0..e9b89f9d02 100644 --- a/sdk/include/opentelemetry/sdk/common/circular_buffer_range.h +++ b/sdk/include/opentelemetry/sdk/common/circular_buffer_range.h @@ -4,8 +4,6 @@ #pragma once #include -#include -#include #include #include "opentelemetry/nostd/span.h" diff --git a/sdk/include/opentelemetry/sdk/common/empty_attributes.h b/sdk/include/opentelemetry/sdk/common/empty_attributes.h index 4f740bf10e..664f907d23 100644 --- a/sdk/include/opentelemetry/sdk/common/empty_attributes.h +++ b/sdk/include/opentelemetry/sdk/common/empty_attributes.h @@ -3,14 +3,14 @@ #pragma once -#include "opentelemetry/common/key_value_iterable_view.h" -#include "opentelemetry/common/macros.h" - #include -#include #include #include +#include "opentelemetry/common/key_value_iterable_view.h" +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/common/global_log_handler.h b/sdk/include/opentelemetry/sdk/common/global_log_handler.h index 56103d3818..74dd90ccc6 100644 --- a/sdk/include/opentelemetry/sdk/common/global_log_handler.h +++ b/sdk/include/opentelemetry/sdk/common/global_log_handler.h @@ -3,7 +3,6 @@ #pragma once -#include #include #include diff --git a/sdk/include/opentelemetry/sdk/instrumentationlibrary/instrumentation_library.h b/sdk/include/opentelemetry/sdk/instrumentationlibrary/instrumentation_library.h index 8a7f9b808a..52f58c6f4e 100644 --- a/sdk/include/opentelemetry/sdk/instrumentationlibrary/instrumentation_library.h +++ b/sdk/include/opentelemetry/sdk/instrumentationlibrary/instrumentation_library.h @@ -4,6 +4,7 @@ #pragma once #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h b/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h index 5d75e61f75..9bae218ba4 100644 --- a/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h +++ b/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h @@ -3,16 +3,16 @@ #pragma once -#include "opentelemetry/common/key_value_iterable.h" +#include + #include "opentelemetry/common/key_value_iterable_view.h" #include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/type_traits.h" #include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/version.h" -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk 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 d13e8782f1..23a1d947aa 100644 --- a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h +++ b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h @@ -8,6 +8,7 @@ # 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 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 55adc68f72..83740542cb 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 @@ -7,9 +7,7 @@ # 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 namespace sdk @@ -18,6 +16,10 @@ namespace sdk namespace logs { +struct BatchLogRecordProcessorOptions; +class LogRecordExporter; +class LogRecordProcessor; + /** * Factory class for BatchLogRecordProcessor. */ diff --git a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_options.h b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_options.h index 1449bb48dc..05a2c48c3c 100644 --- a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_options.h +++ b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_options.h @@ -5,11 +5,11 @@ #ifdef ENABLE_LOGS_PREVIEW -# include "opentelemetry/sdk/version/version.h" - # include # include +# include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/logs/event_logger.h b/sdk/include/opentelemetry/sdk/logs/event_logger.h index 85ad924766..b15754940a 100644 --- a/sdk/include/opentelemetry/sdk/logs/event_logger.h +++ b/sdk/include/opentelemetry/sdk/logs/event_logger.h @@ -4,19 +4,21 @@ #pragma once #ifdef ENABLE_LOGS_PREVIEW -# include -# include +# include -# include "opentelemetry/common/macros.h" # include "opentelemetry/logs/event_logger.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/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace logs { +class Logger; +class LogRecord; class EventLogger final : public opentelemetry::logs::EventLogger { diff --git a/sdk/include/opentelemetry/sdk/logs/event_logger_provider.h b/sdk/include/opentelemetry/sdk/logs/event_logger_provider.h index ba12d94600..0eb9435f45 100644 --- a/sdk/include/opentelemetry/sdk/logs/event_logger_provider.h +++ b/sdk/include/opentelemetry/sdk/logs/event_logger_provider.h @@ -5,9 +5,9 @@ #ifdef ENABLE_LOGS_PREVIEW # include "opentelemetry/logs/event_logger_provider.h" -# include "opentelemetry/logs/logger.h" # include "opentelemetry/nostd/shared_ptr.h" -# include "opentelemetry/sdk/logs/logger.h" +# include "opentelemetry/nostd/string_view.h" +# include "opentelemetry/version.h" // Define the maximum number of loggers that are allowed to be registered to the loggerprovider. // TODO: Add link to logging spec once this is added to it @@ -18,6 +18,7 @@ namespace sdk { namespace logs { +class EventLogger; class Logger; class EventLoggerProvider final : public opentelemetry::logs::EventLoggerProvider diff --git a/sdk/include/opentelemetry/sdk/logs/event_logger_provider_factory.h b/sdk/include/opentelemetry/sdk/logs/event_logger_provider_factory.h index 06aa1c4f2e..ecc78d1b80 100644 --- a/sdk/include/opentelemetry/sdk/logs/event_logger_provider_factory.h +++ b/sdk/include/opentelemetry/sdk/logs/event_logger_provider_factory.h @@ -5,10 +5,15 @@ #ifdef ENABLE_LOGS_PREVIEW -# include "opentelemetry/logs/event_logger_provider.h" -# include "opentelemetry/nostd/shared_ptr.h" +# include +# include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace logs +{ +class EventLoggerProvider; +} // namespace logs + namespace sdk { namespace logs diff --git a/sdk/include/opentelemetry/sdk/logs/exporter.h b/sdk/include/opentelemetry/sdk/logs/exporter.h index 069fd8784c..fc0e68564c 100644 --- a/sdk/include/opentelemetry/sdk/logs/exporter.h +++ b/sdk/include/opentelemetry/sdk/logs/exporter.h @@ -4,19 +4,20 @@ #pragma once #ifdef ENABLE_LOGS_PREVIEW +# include # include -# include # include "opentelemetry/nostd/span.h" # include "opentelemetry/sdk/common/exporter_utils.h" -# include "opentelemetry/sdk/logs/processor.h" -# include "opentelemetry/sdk/logs/recordable.h" +# include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE 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 d290df98c3..67eafe84bc 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger.h +++ b/sdk/include/opentelemetry/sdk/logs/logger.h @@ -5,14 +5,15 @@ #ifdef ENABLE_LOGS_PREVIEW # include -# include +# include # include "opentelemetry/common/macros.h" # include "opentelemetry/logs/logger.h" +# include "opentelemetry/nostd/string_view.h" # include "opentelemetry/nostd/unique_ptr.h" # include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" # include "opentelemetry/sdk/logs/logger_context.h" -# include "opentelemetry/sdk/logs/logger_provider.h" +# include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/logs/logger_context.h b/sdk/include/opentelemetry/sdk/logs/logger_context.h index fe6db6822a..0b2de9bc15 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger_context.h +++ b/sdk/include/opentelemetry/sdk/logs/logger_context.h @@ -5,9 +5,10 @@ #ifdef ENABLE_LOGS_PREVIEW +# include # include +# include -# include "opentelemetry/sdk/logs/processor.h" # include "opentelemetry/sdk/resource/resource.h" # include "opentelemetry/version.h" @@ -16,6 +17,8 @@ namespace sdk { namespace logs { +class LogRecordProcessor; + /** * A class which stores the LoggerContext context. * diff --git a/sdk/include/opentelemetry/sdk/logs/logger_context_factory.h b/sdk/include/opentelemetry/sdk/logs/logger_context_factory.h index 377094d5db..0e3502c10c 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger_context_factory.h +++ b/sdk/include/opentelemetry/sdk/logs/logger_context_factory.h @@ -6,17 +6,22 @@ #ifdef ENABLE_LOGS_PREVIEW # 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 a5190c7a30..3c9211cc36 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger_provider.h +++ b/sdk/include/opentelemetry/sdk/logs/logger_provider.h @@ -6,16 +6,13 @@ # include # include -# include # include # include "opentelemetry/logs/logger_provider.h" -# include "opentelemetry/logs/noop.h" # include "opentelemetry/nostd/shared_ptr.h" -# include "opentelemetry/sdk/common/atomic_shared_ptr.h" -# include "opentelemetry/sdk/logs/logger.h" -# include "opentelemetry/sdk/logs/logger_context.h" -# include "opentelemetry/sdk/logs/processor.h" +# include "opentelemetry/nostd/string_view.h" +# include "opentelemetry/sdk/resource/resource.h" +# include "opentelemetry/version.h" // Define the maximum number of loggers that are allowed to be registered to the loggerprovider. // TODO: Add link to logging spec once this is added to it @@ -27,6 +24,8 @@ namespace sdk namespace logs { class Logger; +class LoggerContext; +class LogRecordProcessor; class LoggerProvider final : public opentelemetry::logs::LoggerProvider { diff --git a/sdk/include/opentelemetry/sdk/logs/logger_provider_factory.h b/sdk/include/opentelemetry/sdk/logs/logger_provider_factory.h index 0795129df3..bbd715dc89 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger_provider_factory.h +++ b/sdk/include/opentelemetry/sdk/logs/logger_provider_factory.h @@ -8,18 +8,25 @@ # include # include -# include "opentelemetry/logs/logger_provider.h" -# include "opentelemetry/nostd/shared_ptr.h" -# include "opentelemetry/sdk/common/atomic_shared_ptr.h" -# include "opentelemetry/sdk/logs/logger.h" -# include "opentelemetry/sdk/logs/logger_context.h" -# include "opentelemetry/sdk/logs/processor.h" +# include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace logs +{ +class LoggerProvider; +} // namespace logs + namespace sdk { +namespace resource +{ +class Resource; +} // namespace resource + namespace logs { +class LoggerContext; +class LogRecordProcessor; /** * Factory class for LoggerProvider. 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 54a7e7959e..91995aa6a3 100644 --- a/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h +++ b/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h @@ -5,12 +5,11 @@ #ifdef ENABLE_LOGS_PREVIEW +# include # include # include -# include "opentelemetry/sdk/logs/multi_recordable.h" # include "opentelemetry/sdk/logs/processor.h" -# include "opentelemetry/sdk/resource/resource.h" # include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -18,6 +17,7 @@ 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 c91cad52ff..c3e87c12db 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 @@ -8,13 +8,14 @@ # include # include -# include "opentelemetry/sdk/logs/processor.h" +# include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE 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 5944d49b39..97ae1451fc 100644 --- a/sdk/include/opentelemetry/sdk/logs/multi_recordable.h +++ b/sdk/include/opentelemetry/sdk/logs/multi_recordable.h @@ -10,7 +10,6 @@ # include # include "opentelemetry/common/macros.h" -# include "opentelemetry/sdk/logs/processor.h" # include "opentelemetry/sdk/logs/recordable.h" # include "opentelemetry/sdk/resource/resource.h" # include "opentelemetry/version.h" @@ -20,6 +19,8 @@ namespace sdk { namespace logs { +class LogRecordProcessor; + class MultiRecordable final : public Recordable { public: diff --git a/sdk/include/opentelemetry/sdk/logs/processor.h b/sdk/include/opentelemetry/sdk/logs/processor.h index 97f823a25b..8a409e0020 100644 --- a/sdk/include/opentelemetry/sdk/logs/processor.h +++ b/sdk/include/opentelemetry/sdk/logs/processor.h @@ -7,14 +7,15 @@ # include # include -# include "opentelemetry/nostd/unique_ptr.h" -# include "opentelemetry/sdk/logs/recordable.h" +# include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace logs { +class Recordable; + /** * The Log Processor is responsible for passing log records * to the configured exporter. diff --git a/sdk/include/opentelemetry/sdk/logs/read_write_log_record.h b/sdk/include/opentelemetry/sdk/logs/read_write_log_record.h index a850072134..915c8852e9 100644 --- a/sdk/include/opentelemetry/sdk/logs/read_write_log_record.h +++ b/sdk/include/opentelemetry/sdk/logs/read_write_log_record.h @@ -6,18 +6,17 @@ # include # include +# include # include "opentelemetry/common/attribute_value.h" # include "opentelemetry/common/key_value_iterable.h" # include "opentelemetry/common/timestamp.h" # include "opentelemetry/logs/log_record.h" # include "opentelemetry/logs/severity.h" -# include "opentelemetry/nostd/unique_ptr.h" +# include "opentelemetry/nostd/string_view.h" # include "opentelemetry/sdk/common/attribute_utils.h" # include "opentelemetry/sdk/common/empty_attributes.h" -# include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" # include "opentelemetry/sdk/logs/readable_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" diff --git a/sdk/include/opentelemetry/sdk/logs/readable_log_record.h b/sdk/include/opentelemetry/sdk/logs/readable_log_record.h index 90a1c4b7b7..ba20ca7949 100644 --- a/sdk/include/opentelemetry/sdk/logs/readable_log_record.h +++ b/sdk/include/opentelemetry/sdk/logs/readable_log_record.h @@ -8,22 +8,32 @@ # include # include "opentelemetry/common/attribute_value.h" -# include "opentelemetry/common/key_value_iterable.h" # include "opentelemetry/common/timestamp.h" # include "opentelemetry/logs/severity.h" -# include "opentelemetry/sdk/common/attribute_utils.h" -# include "opentelemetry/sdk/common/empty_attributes.h" -# include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +# include "opentelemetry/nostd/string_view.h" # include "opentelemetry/sdk/logs/recordable.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 trace +{ +class SpanId; +class TraceId; +class TraceFlags; +} // namespace trace + namespace sdk { +namespace resource +{ +class Resource; +} // namespace resource + +namespace instrumentationscope +{ +class InstrumentationScope; +} // namespace instrumentationscope + namespace logs { /** diff --git a/sdk/include/opentelemetry/sdk/logs/recordable.h b/sdk/include/opentelemetry/sdk/logs/recordable.h index 983a2e6b57..ff0099af56 100644 --- a/sdk/include/opentelemetry/sdk/logs/recordable.h +++ b/sdk/include/opentelemetry/sdk/logs/recordable.h @@ -4,24 +4,22 @@ #pragma once #ifdef ENABLE_LOGS_PREVIEW -# include "opentelemetry/common/attribute_value.h" -# include "opentelemetry/common/key_value_iterable.h" -# include "opentelemetry/common/timestamp.h" # include "opentelemetry/logs/log_record.h" -# include "opentelemetry/logs/severity.h" -# include "opentelemetry/sdk/common/attribute_utils.h" -# include "opentelemetry/sdk/common/empty_attributes.h" -# include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" -# include "opentelemetry/sdk/logs/recordable.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 { +namespace resource +{ +class Resource; +} // namespace resource + +namespace instrumentationscope +{ +class InstrumentationScope; +} // namespace instrumentationscope + namespace logs { /** 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 f3d6bc27c3..4bb3dab2de 100644 --- a/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor.h +++ b/sdk/include/opentelemetry/sdk/logs/simple_log_record_processor.h @@ -5,18 +5,21 @@ #ifdef ENABLE_LOGS_PREVIEW # include +# include # include -# include # include "opentelemetry/common/spin_lock_mutex.h" -# include "opentelemetry/sdk/logs/exporter.h" # include "opentelemetry/sdk/logs/processor.h" +# include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE 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 aec65349c5..cd022aadd6 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 @@ -7,14 +7,15 @@ # include -# include "opentelemetry/sdk/logs/exporter.h" -# include "opentelemetry/sdk/logs/processor.h" +# include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace logs { +class LogRecordExporter; +class LogRecordProcessor; /** * Factory class for SimpleLogRecordProcessor. diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation.h index 361a1cd3b8..a4ec9175c5 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation.h @@ -3,9 +3,11 @@ #pragma once -#include "opentelemetry/nostd/string_view.h" +#include + #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/include/opentelemetry/sdk/metrics/aggregation/aggregation_config.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation_config.h index 69dc4c8864..f5a48d7ddb 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation_config.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation_config.h @@ -3,10 +3,10 @@ #pragma once -#include "opentelemetry/version.h" - #include +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h index 927c17e968..203a2d32b9 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h @@ -4,23 +4,22 @@ #pragma once #include -#include "opentelemetry/common/spin_lock_mutex.h" + #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" #include "opentelemetry/sdk/metrics/aggregation/drop_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/sum_aggregation.h" #include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/sdk/metrics/instruments.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace metrics { +class AggregationConfig; class DefaultAggregation { diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/drop_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/drop_aggregation.h index 713ce60b8e..4664f8dcd4 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/drop_aggregation.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/drop_aggregation.h @@ -3,10 +3,11 @@ #pragma once -#include "opentelemetry/common/spin_lock_mutex.h" -#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include -#include +#include "opentelemetry/sdk/metrics/aggregation/aggregation.h" +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h index 5d1097d93f..4419ee81f3 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h @@ -3,18 +3,20 @@ #pragma once +#include #include + #include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" -#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" - -#include +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace metrics { +class AggregationConfig; class LongHistogramAggregation : public Aggregation { diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h index 05242e304d..859fe26d6b 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 "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" - -#include +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h index 881854e0c2..a098d86b72 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 "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" - -#include +#include "opentelemetry/sdk/metrics/data/point_data.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/async_instruments.h b/sdk/include/opentelemetry/sdk/metrics/async_instruments.h index 321c8089c1..a22ce1f0f8 100644 --- a/sdk/include/opentelemetry/sdk/metrics/async_instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/async_instruments.h @@ -3,11 +3,12 @@ #pragma once +#include + #include "opentelemetry/metrics/async_instruments.h" #include "opentelemetry/metrics/observer_result.h" -#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/metrics/instruments.h" -#include "opentelemetry/sdk/metrics/state/observable_registry.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk @@ -16,6 +17,7 @@ namespace metrics { class AsyncWritableMetricStorage; +class ObservableRegistry; class ObservableInstrument : public opentelemetry::metrics::ObservableInstrument { diff --git a/sdk/include/opentelemetry/sdk/metrics/data/exemplar_data.h b/sdk/include/opentelemetry/sdk/metrics/data/exemplar_data.h index b9f72e9b58..0420b50aab 100644 --- a/sdk/include/opentelemetry/sdk/metrics/data/exemplar_data.h +++ b/sdk/include/opentelemetry/sdk/metrics/data/exemplar_data.h @@ -6,11 +6,10 @@ #include #include "opentelemetry/common/timestamp.h" -#include "opentelemetry/context/context.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/metrics/data/metric_data.h" -#include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/trace/span_context.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/data/metric_data.h b/sdk/include/opentelemetry/sdk/metrics/data/metric_data.h index 28a53dd407..ad1084f581 100644 --- a/sdk/include/opentelemetry/sdk/metrics/data/metric_data.h +++ b/sdk/include/opentelemetry/sdk/metrics/data/metric_data.h @@ -3,12 +3,12 @@ #pragma once +#include + #include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/common/attribute_utils.h" -#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/metrics/data/point_data.h" #include "opentelemetry/sdk/metrics/instruments.h" -#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/metrics/data/point_data.h b/sdk/include/opentelemetry/sdk/metrics/data/point_data.h index 62ba3df1bc..9bf82e040a 100644 --- a/sdk/include/opentelemetry/sdk/metrics/data/point_data.h +++ b/sdk/include/opentelemetry/sdk/metrics/data/point_data.h @@ -3,13 +3,12 @@ #pragma once +#include + #include "opentelemetry/common/timestamp.h" #include "opentelemetry/nostd/variant.h" -#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/version.h" -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/always_sample_filter.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/always_sample_filter.h index c10ec061bb..4a1366aa80 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/always_sample_filter.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/always_sample_filter.h @@ -4,8 +4,14 @@ #pragma once #include "opentelemetry/sdk/metrics/exemplar/filter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/filter.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/filter.h index cfc3439992..f3bc904e26 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/filter.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/filter.h @@ -3,12 +3,24 @@ #pragma once -#include "opentelemetry/context/context.h" +#include + #include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace context +{ +class Context; +} // namespace context + namespace sdk { +namespace common +{ +class OrderedAttributeMap; +} // namespace common + namespace metrics { using MetricAttributes = opentelemetry::sdk::common::OrderedAttributeMap; diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/filtered_exemplar_reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/filtered_exemplar_reservoir.h index 5264c33170..6ed97a689e 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/filtered_exemplar_reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/filtered_exemplar_reservoir.h @@ -5,13 +5,22 @@ #include #include -#include "opentelemetry/context/context.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/attribute_utils.h" + #include "opentelemetry/sdk/metrics/exemplar/filter.h" #include "opentelemetry/sdk/metrics/exemplar/reservoir.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class SystemTimestamp; +} // namespace common + +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h index d2cc13f20c..76f5742ca2 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h @@ -5,6 +5,7 @@ #include #include + #include "opentelemetry/context/context.h" #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/nostd/shared_ptr.h" diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/histogram_exemplar_reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/histogram_exemplar_reservoir.h index 7da7dc8ac0..bbc032df3b 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/histogram_exemplar_reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/histogram_exemplar_reservoir.h @@ -5,16 +5,25 @@ #include #include -#include "opentelemetry/context/context.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/attribute_utils.h" + #include "opentelemetry/sdk/metrics/data/exemplar_data.h" #include "opentelemetry/sdk/metrics/exemplar/filter.h" #include "opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h" #include "opentelemetry/sdk/metrics/exemplar/reservoir.h" #include "opentelemetry/sdk/metrics/exemplar/reservoir_cell_selector.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class OrderedAttributeMap; +} // namespace common + +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/never_sample_filter.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/never_sample_filter.h index 1f2967467b..84d4ef9f77 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/never_sample_filter.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/never_sample_filter.h @@ -4,8 +4,14 @@ #pragma once #include "opentelemetry/sdk/metrics/exemplar/filter.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/no_exemplar_reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/no_exemplar_reservoir.h index d137991f71..edcde3c12f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/no_exemplar_reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/no_exemplar_reservoir.h @@ -3,17 +3,30 @@ #pragma once +#include #include -#include "opentelemetry/context/context.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/attribute_utils.h" + +#include "opentelemetry/sdk/metrics/exemplar/filter.h" #include "opentelemetry/sdk/metrics/exemplar/reservoir.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class SystemTimestamp; +} // namespace common + +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics { +class ExemplarData; + class NoExemplarReservoir final : public ExemplarReservoir { diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir.h index ea418b698d..258e099f0f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir.h @@ -3,16 +3,30 @@ #pragma once +#include #include -#include "opentelemetry/sdk/metrics/data/exemplar_data.h" + #include "opentelemetry/sdk/metrics/exemplar/filter.h" #include "opentelemetry/sdk/metrics/exemplar/reservoir_cell_selector.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class SystemTimestamp; +} // namespace common + +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics { +class ExemplarData; + /** * An interface for an exemplar reservoir of samples. * diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir_cell.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir_cell.h index 2309fc72e4..6074393d2d 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir_cell.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir_cell.h @@ -5,16 +5,20 @@ #include #include -#include + #include "opentelemetry/common/timestamp.h" -#include "opentelemetry/context/context.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/metrics/data/exemplar_data.h" #include "opentelemetry/sdk/metrics/exemplar/filter.h" #include "opentelemetry/trace/context.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir_cell_selector.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir_cell_selector.h index 1017d64aa7..b3b2f09e23 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir_cell_selector.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir_cell_selector.h @@ -4,14 +4,18 @@ #pragma once #include -#include #include -#include "opentelemetry/context/context.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/attribute_utils.h" + +#include "opentelemetry/sdk/metrics/exemplar/filter.h" #include "opentelemetry/sdk/metrics/exemplar/reservoir_cell.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/with_trace_sample_filter.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/with_trace_sample_filter.h index de01cbc632..fbc0489d3d 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/with_trace_sample_filter.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/with_trace_sample_filter.h @@ -5,6 +5,7 @@ #include "opentelemetry/sdk/metrics/exemplar/filter.h" #include "opentelemetry/trace/context.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/export/metric_producer.h b/sdk/include/opentelemetry/sdk/metrics/export/metric_producer.h index 82b8c1c474..2a0c87fcaa 100644 --- a/sdk/include/opentelemetry/sdk/metrics/export/metric_producer.h +++ b/sdk/include/opentelemetry/sdk/metrics/export/metric_producer.h @@ -3,13 +3,25 @@ #pragma once -#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include + +#include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/metrics/data/metric_data.h" -#include "opentelemetry/sdk/resource/resource.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { +namespace resource +{ +class Resource; +} // namespace resource + +namespace instrumentationscope +{ +class InstrumentationScope; +} // namespace instrumentationscope + namespace metrics { 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 83773ffb61..29c2e351e5 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 @@ -3,14 +3,16 @@ #pragma once -#include "opentelemetry/sdk/metrics/metric_reader.h" -#include "opentelemetry/version.h" - #include #include #include +#include +#include #include +#include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/instrument_metadata_validator.h b/sdk/include/opentelemetry/sdk/metrics/instrument_metadata_validator.h index 95848a8eec..fec1027746 100644 --- a/sdk/include/opentelemetry/sdk/metrics/instrument_metadata_validator.h +++ b/sdk/include/opentelemetry/sdk/metrics/instrument_metadata_validator.h @@ -4,6 +4,7 @@ #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/instruments.h b/sdk/include/opentelemetry/sdk/metrics/instruments.h index 6c6497555b..84244128a4 100644 --- a/sdk/include/opentelemetry/sdk/metrics/instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/instruments.h @@ -4,8 +4,10 @@ #pragma once #include -#include "opentelemetry/common/macros.h" +#include + #include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/meter.h b/sdk/include/opentelemetry/sdk/metrics/meter.h index 6beff61063..41a10f69e9 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter.h +++ b/sdk/include/opentelemetry/sdk/metrics/meter.h @@ -4,15 +4,22 @@ #pragma once #include +#include +#include +#include +#include + +#include "opentelemetry/common/macros.h" #include "opentelemetry/metrics/meter.h" #include "opentelemetry/metrics/noop.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/metrics/instrument_metadata_validator.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/metrics/state/async_metric_storage.h" - -#include "opentelemetry/common/macros.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk_config.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 75ab2a4be9..8155b4da9f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter_context.h +++ b/sdk/include/opentelemetry/sdk/metrics/meter_context.h @@ -3,18 +3,19 @@ #pragma once +#include +#include +#include +#include + #include "opentelemetry/common/spin_lock_mutex.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/common/timestamp.h" +#include "opentelemetry/nostd/function_ref.h" +#include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/metrics/view/view_registry.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" -#include -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { @@ -22,8 +23,11 @@ namespace metrics { // forward declaration +class CollectorHandle; +class InstrumentSelector; class Meter; class MetricReader; +class MeterSelector; /** * A class which stores the MeterProvider context. diff --git a/sdk/include/opentelemetry/sdk/metrics/meter_provider.h b/sdk/include/opentelemetry/sdk/metrics/meter_provider.h index f2c72e2d25..fedf6aac61 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter_provider.h +++ b/sdk/include/opentelemetry/sdk/metrics/meter_provider.h @@ -3,24 +3,30 @@ #pragma once +#include #include #include -#include -#include "opentelemetry/metrics/meter.h" + #include "opentelemetry/metrics/meter_provider.h" #include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/metrics/meter.h" -#include "opentelemetry/sdk/metrics/meter_context.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/sdk/metrics/view/view_registry.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace metrics +{ +class Meter; +} // namespace metrics + namespace sdk { namespace metrics { // forward declaration +class MeterContext; class MetricCollector; class MetricReader; @@ -40,7 +46,7 @@ class MeterProvider final : public opentelemetry::metrics::MeterProvider * Initialize a new meter provider with a specified context * @param context The shared meter configuration/pipeline for this provider. */ - explicit MeterProvider(std::shared_ptr context) noexcept; + explicit MeterProvider(std::shared_ptr context) noexcept; nostd::shared_ptr GetMeter( nostd::string_view name, @@ -88,7 +94,7 @@ class MeterProvider final : public opentelemetry::metrics::MeterProvider ~MeterProvider() override; private: - std::shared_ptr context_; + std::shared_ptr context_; std::mutex lock_; }; } // namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/metric_reader.h b/sdk/include/opentelemetry/sdk/metrics/metric_reader.h index 86101e39a0..96b34a4427 100644 --- a/sdk/include/opentelemetry/sdk/metrics/metric_reader.h +++ b/sdk/include/opentelemetry/sdk/metrics/metric_reader.h @@ -3,21 +3,22 @@ #pragma once +#include +#include + #include "opentelemetry/common/spin_lock_mutex.h" -#include "opentelemetry/sdk/common/global_log_handler.h" +#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" -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE 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/observer_result.h b/sdk/include/opentelemetry/sdk/metrics/observer_result.h index 4b6a55e3bc..38c5843633 100644 --- a/sdk/include/opentelemetry/sdk/metrics/observer_result.h +++ b/sdk/include/opentelemetry/sdk/metrics/observer_result.h @@ -3,12 +3,13 @@ #pragma once +#include + #include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/metrics/observer_result.h" #include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/push_metric_exporter.h b/sdk/include/opentelemetry/sdk/metrics/push_metric_exporter.h index 58e2c68c62..409a826ca9 100644 --- a/sdk/include/opentelemetry/sdk/metrics/push_metric_exporter.h +++ b/sdk/include/opentelemetry/sdk/metrics/push_metric_exporter.h @@ -3,21 +3,20 @@ #pragma once -#include "opentelemetry/nostd/span.h" +#include + #include "opentelemetry/sdk/common/exporter_utils.h" -#include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/version.h" -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace metrics { - class MetricData; +struct ResourceMetrics; + /** * PushMetricExporter defines the interface to be used by metrics libraries to * push metrics data to the OpenTelemetry exporters. diff --git a/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h index aad00bb5cf..aada06142a 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h @@ -3,6 +3,10 @@ #pragma once +#include +#include +#include + #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/sdk/common/attributemap_hash.h" #include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" @@ -14,8 +18,6 @@ #include "opentelemetry/sdk/metrics/state/temporal_metric_storage.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/state/metric_collector.h b/sdk/include/opentelemetry/sdk/metrics/state/metric_collector.h index 95cd8a7d10..e94c005ecc 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/metric_collector.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/metric_collector.h @@ -3,8 +3,12 @@ #pragma once -#include "opentelemetry/sdk/metrics/data/metric_data.h" +#include +#include + #include "opentelemetry/sdk/metrics/export/metric_producer.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/state/metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/metric_storage.h index 0f8f4ddba7..277b45fbb6 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/metric_storage.h @@ -3,14 +3,28 @@ #pragma once -#include "opentelemetry/common/key_value_iterable_view.h" +#include +#include + #include "opentelemetry/common/timestamp.h" -#include "opentelemetry/context/context.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/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class KeyValueIterable; +} // namespace common + +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h index 421c12b34c..6202b0c7fb 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h @@ -3,13 +3,26 @@ #pragma once -#include "opentelemetry/common/key_value_iterable_view.h" +#include +#include +#include + +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class KeyValueIterable; +} // namespace common + +namespace context +{ +class Context; +} // namespace context + namespace sdk { namespace metrics diff --git a/sdk/include/opentelemetry/sdk/metrics/state/observable_registry.h b/sdk/include/opentelemetry/sdk/metrics/state/observable_registry.h index 09c439afa4..5eb5b6d6ff 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/observable_registry.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/observable_registry.h @@ -3,13 +3,14 @@ #pragma once -#include "opentelemetry/common/timestamp.h" -#include "opentelemetry/metrics/async_instruments.h" - #include #include #include +#include "opentelemetry/common/timestamp.h" +#include "opentelemetry/metrics/async_instruments.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { 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 b8146872e3..37b0e06707 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h @@ -3,8 +3,18 @@ #pragma once +#include +#include +#include +#include +#include #include -#include "opentelemetry/common/key_value_iterable_view.h" + +#include "opentelemetry/common/spin_lock_mutex.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/default_aggregation.h" #include "opentelemetry/sdk/metrics/exemplar/reservoir.h" @@ -14,9 +24,7 @@ #include "opentelemetry/sdk/metrics/state/temporal_metric_storage.h" #include "opentelemetry/sdk/metrics/view/attributes_processor.h" - -#include -#include +#include "opentelemetry/version.h" 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 4ddc593149..0a08e7d100 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/temporal_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/temporal_metric_storage.h @@ -3,19 +3,26 @@ #pragma once -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" -#include "opentelemetry/sdk/metrics/state/metric_collector.h" - #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/instruments.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE 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 803191170c..825547a846 100644 --- a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h @@ -3,14 +3,13 @@ #pragma once -#include "opentelemetry/common/key_value_iterable.h" +#include + #include "opentelemetry/metrics/sync_instruments.h" -#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" #include "opentelemetry/sdk_config.h" - -#include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h index c3328bfa1e..91e4b268cf 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h @@ -3,7 +3,14 @@ #pragma once +#include +#include + +#include "opentelemetry/common/key_value_iterable.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/metrics/instruments.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/view/instrument_selector.h b/sdk/include/opentelemetry/sdk/metrics/view/instrument_selector.h index a8cf38b49f..2055ed96fa 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/instrument_selector.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/instrument_selector.h @@ -3,9 +3,13 @@ #pragma once +#include + #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/view/predicate_factory.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/metrics/view/meter_selector.h b/sdk/include/opentelemetry/sdk/metrics/view/meter_selector.h index de61d21412..16d777b71f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/meter_selector.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/meter_selector.h @@ -3,8 +3,11 @@ #pragma once +#include + #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/metrics/view/predicate_factory.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/view/predicate_factory.h b/sdk/include/opentelemetry/sdk/metrics/view/predicate_factory.h index 7df3955873..ba2303ff92 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/predicate_factory.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/predicate_factory.h @@ -3,8 +3,11 @@ #pragma once +#include + #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/metrics/view/predicate.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/view/view.h b/sdk/include/opentelemetry/sdk/metrics/view/view.h index 678c53f6c6..2d3edcee0e 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/view.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/view.h @@ -3,12 +3,13 @@ #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/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/view/view_registry.h b/sdk/include/opentelemetry/sdk/metrics/view/view_registry.h index 87773b2091..9f12259665 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/view_registry.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/view_registry.h @@ -3,11 +3,16 @@ #pragma once +#include #include +#include + +#include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.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/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/resource/resource.h b/sdk/include/opentelemetry/sdk/resource/resource.h index 09da0b8c97..d578491d78 100644 --- a/sdk/include/opentelemetry/sdk/resource/resource.h +++ b/sdk/include/opentelemetry/sdk/resource/resource.h @@ -3,18 +3,11 @@ #pragma once -#include "opentelemetry/common/attribute_value.h" -#include "opentelemetry/common/key_value_iterable_view.h" +#include #include "opentelemetry/sdk/common/attribute_utils.h" -#include "opentelemetry/sdk/resource/resource_detector.h" -#include "opentelemetry/sdk/version/version.h" #include "opentelemetry/version.h" -#include -#include -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/resource/resource_detector.h b/sdk/include/opentelemetry/sdk/resource/resource_detector.h index 6447a2660d..dcbd874847 100644 --- a/sdk/include/opentelemetry/sdk/resource/resource_detector.h +++ b/sdk/include/opentelemetry/sdk/resource/resource_detector.h @@ -3,7 +3,7 @@ #pragma once -#include "opentelemetry/nostd/unique_ptr.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -12,8 +12,6 @@ namespace sdk namespace resource { -class Resource; - /** * Interface for a Resource Detector */ diff --git a/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h b/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h index 60e93d8a9f..34d499a2ef 100644 --- a/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h +++ b/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h @@ -3,21 +3,23 @@ #pragma once -#include "opentelemetry/sdk/common/circular_buffer.h" -#include "opentelemetry/sdk/trace/batch_span_processor_options.h" -#include "opentelemetry/sdk/trace/exporter.h" -#include "opentelemetry/sdk/trace/processor.h" - #include #include +#include +#include #include +#include "opentelemetry/sdk/common/circular_buffer.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { - namespace trace { +class SpanExporter; +struct BatchSpanProcessorOptions; /** * This is an implementation of the SpanProcessor which creates batches of finished spans and passes diff --git a/sdk/include/opentelemetry/sdk/trace/batch_span_processor_factory.h b/sdk/include/opentelemetry/sdk/trace/batch_span_processor_factory.h index 6e66d2d2b9..4f645b2633 100644 --- a/sdk/include/opentelemetry/sdk/trace/batch_span_processor_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/batch_span_processor_factory.h @@ -5,16 +5,16 @@ #include -#include "opentelemetry/sdk/trace/batch_span_processor_options.h" -#include "opentelemetry/sdk/trace/exporter.h" -#include "opentelemetry/sdk/trace/processor.h" -#include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class SpanExporter; +class SpanProcessor; +struct BatchSpanProcessorOptions; /** * Factory class for BatchSpanProcessor. diff --git a/sdk/include/opentelemetry/sdk/trace/batch_span_processor_options.h b/sdk/include/opentelemetry/sdk/trace/batch_span_processor_options.h index 053126c065..ac1052383b 100644 --- a/sdk/include/opentelemetry/sdk/trace/batch_span_processor_options.h +++ b/sdk/include/opentelemetry/sdk/trace/batch_span_processor_options.h @@ -3,10 +3,10 @@ #pragma once -#include "opentelemetry/sdk/version/version.h" - #include +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/trace/exporter.h b/sdk/include/opentelemetry/sdk/trace/exporter.h index ffacca2b35..f9ed068b64 100644 --- a/sdk/include/opentelemetry/sdk/trace/exporter.h +++ b/sdk/include/opentelemetry/sdk/trace/exporter.h @@ -3,16 +3,20 @@ #pragma once +#include #include + #include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/common/exporter_utils.h" -#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class Recordable; + /** * SpanExporter defines the interface that protocol-specific span exporters must * implement. @@ -40,8 +44,7 @@ class OPENTELEMETRY_EXPORT SpanExporter * @param spans a span of unique pointers to span recordables */ virtual sdk::common::ExportResult Export( - const nostd::span> - &spans) noexcept = 0; + const nostd::span> &spans) noexcept = 0; /** * Export all spans that have been exported. diff --git a/sdk/include/opentelemetry/sdk/trace/id_generator.h b/sdk/include/opentelemetry/sdk/trace/id_generator.h index 559870d961..bd807ff89a 100644 --- a/sdk/include/opentelemetry/sdk/trace/id_generator.h +++ b/sdk/include/opentelemetry/sdk/trace/id_generator.h @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #pragma once + #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/trace_id.h" #include "opentelemetry/version.h" diff --git a/sdk/include/opentelemetry/sdk/trace/multi_recordable.h b/sdk/include/opentelemetry/sdk/trace/multi_recordable.h index 6abd39f90b..8519591286 100644 --- a/sdk/include/opentelemetry/sdk/trace/multi_recordable.h +++ b/sdk/include/opentelemetry/sdk/trace/multi_recordable.h @@ -3,13 +3,13 @@ #pragma once +#include + #include "opentelemetry/common/timestamp.h" #include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/recordable.h" #include "opentelemetry/version.h" -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/include/opentelemetry/sdk/trace/multi_span_processor.h b/sdk/include/opentelemetry/sdk/trace/multi_span_processor.h index e3b4a2031e..094c5b3e24 100644 --- a/sdk/include/opentelemetry/sdk/trace/multi_span_processor.h +++ b/sdk/include/opentelemetry/sdk/trace/multi_span_processor.h @@ -3,13 +3,14 @@ #pragma once +#include +#include #include #include #include "opentelemetry/sdk/trace/multi_recordable.h" #include "opentelemetry/sdk/trace/processor.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/trace/processor.h b/sdk/include/opentelemetry/sdk/trace/processor.h index f87b893837..3701422eb5 100644 --- a/sdk/include/opentelemetry/sdk/trace/processor.h +++ b/sdk/include/opentelemetry/sdk/trace/processor.h @@ -5,13 +5,21 @@ #include #include -#include "opentelemetry/sdk/trace/recordable.h" + +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace trace +{ +class SpanContext; +} // namespace trace + namespace sdk { namespace trace { +class Recordable; + /** * Span processor allow hooks for span start and end method invocations. * diff --git a/sdk/include/opentelemetry/sdk/trace/random_id_generator.h b/sdk/include/opentelemetry/sdk/trace/random_id_generator.h index 59df91651f..f06f02f5e7 100644 --- a/sdk/include/opentelemetry/sdk/trace/random_id_generator.h +++ b/sdk/include/opentelemetry/sdk/trace/random_id_generator.h @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 #pragma once + #include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/trace/random_id_generator_factory.h b/sdk/include/opentelemetry/sdk/trace/random_id_generator_factory.h index 1b8f7e3c3b..6c94984403 100644 --- a/sdk/include/opentelemetry/sdk/trace/random_id_generator_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/random_id_generator_factory.h @@ -5,13 +5,14 @@ #include -#include "opentelemetry/sdk/trace/id_generator.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class IdGenerator; /** * Factory class for RandomIdGenerator. diff --git a/sdk/include/opentelemetry/sdk/trace/recordable.h b/sdk/include/opentelemetry/sdk/trace/recordable.h index 721e33232d..cb73ef5f64 100644 --- a/sdk/include/opentelemetry/sdk/trace/recordable.h +++ b/sdk/include/opentelemetry/sdk/trace/recordable.h @@ -3,27 +3,33 @@ #pragma once +#include + #include "opentelemetry/common/attribute_value.h" -#include "opentelemetry/common/key_value_iterable.h" #include "opentelemetry/common/timestamp.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/empty_attributes.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" -#include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/trace/canonical_code.h" -#include "opentelemetry/trace/span.h" #include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_id.h" -#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/trace/span_metadata.h" #include "opentelemetry/version.h" -#include - // TODO: Create generic short pattern for opentelemetry::common and opentelemetry::trace OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class KeyValueIterable; +} // namespace common + namespace sdk { +namespace resource +{ +class Resource; +} // namespace resource + namespace trace { diff --git a/sdk/include/opentelemetry/sdk/trace/sampler.h b/sdk/include/opentelemetry/sdk/trace/sampler.h index 799d490e8b..b90a2e66b2 100644 --- a/sdk/include/opentelemetry/sdk/trace/sampler.h +++ b/sdk/include/opentelemetry/sdk/trace/sampler.h @@ -3,19 +3,30 @@ #pragma once -#include "opentelemetry/common/attribute_value.h" -#include "opentelemetry/trace/span.h" -#include "opentelemetry/trace/span_context.h" -#include "opentelemetry/trace/span_context_kv_iterable.h" -#include "opentelemetry/trace/trace_id.h" -#include "opentelemetry/trace/trace_state.h" -#include "opentelemetry/version.h" - #include #include #include +#include "opentelemetry/common/attribute_value.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" + OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class KeyValueIterable; +} // namespace common + +namespace trace +{ +class SpanContext; +class SpanContextKeyValueIterable; +class TraceState; +} // namespace trace + namespace sdk { namespace trace diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/always_off.h b/sdk/include/opentelemetry/sdk/trace/samplers/always_off.h index 2392b9b2fb..a857086d23 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/always_off.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/always_off.h @@ -3,7 +3,12 @@ #pragma once +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/always_off_factory.h b/sdk/include/opentelemetry/sdk/trace/samplers/always_off_factory.h index 2ae09b229c..19f76c715f 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/always_off_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/always_off_factory.h @@ -5,13 +5,14 @@ #include -#include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class Sampler; /** * Factory class for AlwaysOffSampler. diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/always_on.h b/sdk/include/opentelemetry/sdk/trace/samplers/always_on.h index 6c8583599d..6b983008c7 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/always_on.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/always_on.h @@ -3,9 +3,24 @@ #pragma once +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/trace/span_context.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class KeyValueIterable; +} // namespace common + +namespace trace +{ +class SpanContextKeyValueIterable; +} // namespace trace + namespace sdk { namespace trace diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/always_on_factory.h b/sdk/include/opentelemetry/sdk/trace/samplers/always_on_factory.h index 3484f0d4fa..c72d97fdec 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/always_on_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/always_on_factory.h @@ -5,13 +5,14 @@ #include -#include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class Sampler; /** * Factory class for AlwaysOnSampler. diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/parent.h b/sdk/include/opentelemetry/sdk/trace/samplers/parent.h index c76a6c2a58..59dd314589 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/parent.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/parent.h @@ -3,10 +3,25 @@ #pragma once -#include "opentelemetry/sdk/common/atomic_shared_ptr.h" +#include + +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class KeyValueIterable; +} // namespace common + +namespace trace +{ +class SpanContext; +class SpanContextKeyValueIterable; +class TraceState; +} // namespace trace + namespace sdk { namespace trace diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h b/sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h index 006bdab1da..2fdf87819d 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h @@ -5,13 +5,14 @@ #include -#include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class Sampler; /** * Factory class for ParentBasedSampler. diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio.h b/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio.h index 407b480d62..b5df576091 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio.h @@ -3,9 +3,27 @@ #pragma once +#include + +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/trace/span_metadata.h" +#include "opentelemetry/trace/trace_id.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace common +{ +class KeyValueIterable; +} // namespace common + +namespace trace +{ +class SpanContext; +class SpanContextKeyValueIterable; +class TraceState; +} // namespace trace + namespace sdk { namespace trace diff --git a/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h b/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h index 79728ba200..eb434fc6fe 100644 --- a/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/samplers/trace_id_ratio_factory.h @@ -5,13 +5,14 @@ #include -#include "opentelemetry/sdk/trace/sampler.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class Sampler; /** * Factory class for TraceIdRatioBasedSampler. diff --git a/sdk/include/opentelemetry/sdk/trace/simple_processor.h b/sdk/include/opentelemetry/sdk/trace/simple_processor.h index 671218d0cf..dee8e80bb8 100644 --- a/sdk/include/opentelemetry/sdk/trace/simple_processor.h +++ b/sdk/include/opentelemetry/sdk/trace/simple_processor.h @@ -4,11 +4,16 @@ #pragma once #include +#include +#include #include #include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/trace/simple_processor_factory.h b/sdk/include/opentelemetry/sdk/trace/simple_processor_factory.h index efa3078a38..6a106e7f21 100644 --- a/sdk/include/opentelemetry/sdk/trace/simple_processor_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/simple_processor_factory.h @@ -5,14 +5,15 @@ #include -#include "opentelemetry/sdk/trace/exporter.h" -#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class SpanExporter; +class SpanProcessor; /** * Factory class for SimpleSpanProcessor. diff --git a/sdk/include/opentelemetry/sdk/trace/span_data.h b/sdk/include/opentelemetry/sdk/trace/span_data.h index 61a7ced6fe..4e1a52ce5d 100644 --- a/sdk/include/opentelemetry/sdk/trace/span_data.h +++ b/sdk/include/opentelemetry/sdk/trace/span_data.h @@ -4,20 +4,23 @@ #pragma once #include +#include +#include +#include #include #include + #include "opentelemetry/common/attribute_value.h" #include "opentelemetry/common/macros.h" #include "opentelemetry/common/timestamp.h" #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/attribute_utils.h" +#include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/recordable.h" -#include "opentelemetry/trace/canonical_code.h" #include "opentelemetry/trace/span.h" #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/trace_id.h" - -#include +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/trace/tracer.h b/sdk/include/opentelemetry/sdk/trace/tracer.h index 3ac17aad66..67e606ba97 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer.h @@ -3,40 +3,46 @@ #pragma once +#include + #include "opentelemetry/common/macros.h" -#include "opentelemetry/sdk/common/atomic_shared_ptr.h" +#include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" -#include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" #include "opentelemetry/sdk/trace/tracer_context.h" -#include "opentelemetry/trace/noop.h" #include "opentelemetry/trace/tracer.h" #include "opentelemetry/version.h" -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { +namespace resource +{ +class Resource; +} // namespace resource + namespace trace { +class IdGenerator; +class SpanProcessor; using namespace opentelemetry::sdk::instrumentationscope; -class Tracer final : public trace_api::Tracer, public std::enable_shared_from_this +class Tracer final : public opentelemetry::trace::Tracer, + public std::enable_shared_from_this { public: /** Construct a new Tracer with the given context pipeline. */ - explicit Tracer(std::shared_ptr context, + explicit Tracer(std::shared_ptr context, std::unique_ptr instrumentation_scope = InstrumentationScope::Create("")) noexcept; - nostd::shared_ptr StartSpan( + nostd::shared_ptr StartSpan( nostd::string_view name, const opentelemetry::common::KeyValueIterable &attributes, - const trace_api::SpanContextKeyValueIterable &links, - const trace_api::StartSpanOptions &options = {}) noexcept override; + const opentelemetry::trace::SpanContextKeyValueIterable &links, + const opentelemetry::trace::StartSpanOptions &options = {}) noexcept override; void ForceFlushWithMicroseconds(uint64_t timeout) noexcept override; @@ -70,7 +76,7 @@ class Tracer final : public trace_api::Tracer, public std::enable_shared_from_th // order of declaration is important here - instrumentation scope should destroy after // tracer-context. std::shared_ptr instrumentation_scope_; - std::shared_ptr context_; + std::shared_ptr context_; }; } // namespace trace } // namespace sdk diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_context.h b/sdk/include/opentelemetry/sdk/trace/tracer_context.h index 6dcdda8e01..9475c8c0b9 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_context.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_context.h @@ -3,7 +3,10 @@ #pragma once -#include "opentelemetry/sdk/common/atomic_unique_ptr.h" +#include +#include +#include + #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/random_id_generator.h" diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_context_factory.h b/sdk/include/opentelemetry/sdk/trace/tracer_context_factory.h index b03ae297fc..1911db8f93 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_context_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_context_factory.h @@ -3,16 +3,25 @@ #pragma once -#include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/trace/processor.h" -#include "opentelemetry/sdk/trace/tracer_context.h" +#include +#include + #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { +namespace resource +{ +class Resource; +} // namespace resource + namespace trace { +class IdGenerator; +class Sampler; +class SpanProcessor; +class TracerContext; /** * Factory class for TracerContext. diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_provider.h b/sdk/include/opentelemetry/sdk/trace/tracer_provider.h index 06088738c2..e15f686898 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_provider.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_provider.h @@ -10,18 +10,22 @@ #include #include "opentelemetry/nostd/shared_ptr.h" +#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/random_id_generator.h" #include "opentelemetry/sdk/trace/samplers/always_on.h" -#include "opentelemetry/sdk/trace/tracer.h" -#include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { namespace trace { +class SpanProcessor; +class Tracer; +class TracerContext; + class TracerProvider final : public opentelemetry::trace::TracerProvider { public: @@ -40,24 +44,22 @@ class TracerProvider final : public opentelemetry::trace::TracerProvider opentelemetry::sdk::resource::Resource resource = opentelemetry::sdk::resource::Resource::Create({}), std::unique_ptr sampler = std::unique_ptr(new AlwaysOnSampler), - std::unique_ptr id_generator = - std::unique_ptr( - new RandomIdGenerator())) noexcept; + std::unique_ptr id_generator = + std::unique_ptr(new RandomIdGenerator())) noexcept; explicit TracerProvider( std::vector> &&processors, opentelemetry::sdk::resource::Resource resource = opentelemetry::sdk::resource::Resource::Create({}), std::unique_ptr sampler = std::unique_ptr(new AlwaysOnSampler), - std::unique_ptr id_generator = - std::unique_ptr( - new RandomIdGenerator())) noexcept; + std::unique_ptr id_generator = + std::unique_ptr(new RandomIdGenerator())) noexcept; /** * Initialize a new tracer provider with a specified context * @param context The shared tracer configuration/pipeline for this provider. */ - explicit TracerProvider(std::shared_ptr context) noexcept; + explicit TracerProvider(std::shared_ptr context) noexcept; ~TracerProvider() override; @@ -94,8 +96,8 @@ class TracerProvider final : public opentelemetry::trace::TracerProvider private: // order of declaration is important here - tracers should destroy only after context. - std::vector> tracers_; - std::shared_ptr context_; + std::vector> tracers_; + std::shared_ptr context_; std::mutex lock_; }; } // namespace trace diff --git a/sdk/include/opentelemetry/sdk/trace/tracer_provider_factory.h b/sdk/include/opentelemetry/sdk/trace/tracer_provider_factory.h index 14458b2409..93bd1085ac 100644 --- a/sdk/include/opentelemetry/sdk/trace/tracer_provider_factory.h +++ b/sdk/include/opentelemetry/sdk/trace/tracer_provider_factory.h @@ -4,16 +4,29 @@ #pragma once #include +#include -#include "opentelemetry/sdk/trace/processor.h" -#include "opentelemetry/sdk/trace/tracer_context.h" -#include "opentelemetry/trace/tracer_provider.h" +#include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE +namespace trace +{ +class TracerProvider; +} // namespace trace + namespace sdk { +namespace resource +{ +class Resource; +} // namespace resource + namespace trace { +class IdGenerator; +class Sampler; +class SpanProcessor; +class TracerContext; /** * Factory class for TracerProvider. @@ -65,7 +78,7 @@ class OPENTELEMETRY_EXPORT TracerProviderFactory /* Create with a tracer context. */ static std::unique_ptr Create( - std::shared_ptr context); + std::shared_ptr context); }; } // namespace trace diff --git a/sdk/src/common/global_log_handler.cc b/sdk/src/common/global_log_handler.cc index 040e3e2154..bd1b56a9cd 100644 --- a/sdk/src/common/global_log_handler.cc +++ b/sdk/src/common/global_log_handler.cc @@ -3,8 +3,7 @@ #include "opentelemetry/sdk/common/global_log_handler.h" -#include -#include +#include OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/logs/batch_log_record_processor.cc b/sdk/src/logs/batch_log_record_processor.cc index 6b1db1c666..5487d70e80 100644 --- a/sdk/src/logs/batch_log_record_processor.cc +++ b/sdk/src/logs/batch_log_record_processor.cc @@ -2,10 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_LOGS_PREVIEW + # include "opentelemetry/sdk/logs/batch_log_record_processor.h" # include "opentelemetry/common/spin_lock_mutex.h" +# include "opentelemetry/common/timestamp.h" +# include "opentelemetry/sdk/logs/recordable.h" # include + using opentelemetry::sdk::common::AtomicUniquePtr; using opentelemetry::sdk::common::CircularBufferRange; diff --git a/sdk/src/logs/logger.cc b/sdk/src/logs/logger.cc index 4c76b198bb..e9ebb8bdc4 100644 --- a/sdk/src/logs/logger.cc +++ b/sdk/src/logs/logger.cc @@ -2,8 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_LOGS_PREVIEW + # include "opentelemetry/sdk/logs/logger.h" # include "opentelemetry/context/runtime_context.h" +# include "opentelemetry/sdk/logs/processor.h" +# include "opentelemetry/sdk/logs/recordable.h" # include "opentelemetry/sdk_config.h" # include "opentelemetry/trace/provider.h" @@ -47,10 +50,10 @@ 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 (nostd::holds_alternative>(context_value)) { - nostd::shared_ptr &data = - nostd::get>(context_value); + nostd::shared_ptr &data = + nostd::get>(context_value); if (data) { recordable->SetTraceId(data->GetContext().trace_id()); diff --git a/sdk/src/logs/logger_context_factory.cc b/sdk/src/logs/logger_context_factory.cc index 985743fd67..1fc07f53e5 100644 --- a/sdk/src/logs/logger_context_factory.cc +++ b/sdk/src/logs/logger_context_factory.cc @@ -4,6 +4,9 @@ #ifdef ENABLE_LOGS_PREVIEW # include "opentelemetry/sdk/logs/logger_context_factory.h" +# include "opentelemetry/sdk/logs/logger_context.h" +# include "opentelemetry/sdk/logs/processor.h" +# include "opentelemetry/sdk/resource/resource.h" # include # include diff --git a/sdk/src/logs/logger_provider.cc b/sdk/src/logs/logger_provider.cc index 66948b1744..1e1b83c7de 100644 --- a/sdk/src/logs/logger_provider.cc +++ b/sdk/src/logs/logger_provider.cc @@ -5,12 +5,10 @@ # include "opentelemetry/sdk/logs/logger_provider.h" # include "opentelemetry/sdk/common/global_log_handler.h" - -# include -# include -# include -# include -# include +# 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" 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 2859126f80..f6e6c2e176 100644 --- a/sdk/src/logs/multi_log_record_processor.cc +++ b/sdk/src/logs/multi_log_record_processor.cc @@ -4,10 +4,8 @@ #ifdef ENABLE_LOGS_PREVIEW # include "opentelemetry/sdk/logs/multi_log_record_processor.h" - -# include -# include -# include +# include "opentelemetry/sdk/logs/multi_recordable.h" +# include "opentelemetry/sdk/logs/recordable.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 9ed5ca7ae7..f02d475d47 100644 --- a/sdk/src/logs/readable_log_record.cc +++ b/sdk/src/logs/readable_log_record.cc @@ -3,11 +3,14 @@ #ifdef ENABLE_LOGS_PREVIEW +# include "opentelemetry/sdk/logs/readable_log_record.h" +# include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" +# include "opentelemetry/sdk/resource/resource.h" +# include "opentelemetry/sdk/version/version.h" + # include # include -# include "opentelemetry/sdk/logs/readable_log_record.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 50d4c20fdd..6514c7acff 100644 --- a/sdk/src/logs/simple_log_record_processor.cc +++ b/sdk/src/logs/simple_log_record_processor.cc @@ -2,10 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_LOGS_PREVIEW + # include "opentelemetry/sdk/logs/simple_log_record_processor.h" +# include "opentelemetry/nostd/span.h" +# include "opentelemetry/sdk/logs/exporter.h" +# include "opentelemetry/sdk/logs/recordable.h" -# include -# include +# include OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/aggregation/histogram_aggregation.cc b/sdk/src/metrics/aggregation/histogram_aggregation.cc index fe01030f13..3213c27f16 100644 --- a/sdk/src/metrics/aggregation/histogram_aggregation.cc +++ b/sdk/src/metrics/aggregation/histogram_aggregation.cc @@ -2,6 +2,7 @@ // 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 diff --git a/sdk/src/metrics/async_instruments.cc b/sdk/src/metrics/async_instruments.cc index 1d2b1a9552..082d6713b4 100644 --- a/sdk/src/metrics/async_instruments.cc +++ b/sdk/src/metrics/async_instruments.cc @@ -3,10 +3,9 @@ #include "opentelemetry/sdk/metrics/async_instruments.h" #include "opentelemetry/sdk/metrics/state/metric_storage.h" +#include "opentelemetry/sdk/metrics/state/observable_registry.h" #include "opentelemetry/sdk_config.h" -#include - OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/src/metrics/meter_context.cc b/sdk/src/metrics/meter_context.cc index de25153e1d..eaf82232d6 100644 --- a/sdk/src/metrics/meter_context.cc +++ b/sdk/src/metrics/meter_context.cc @@ -4,8 +4,10 @@ #include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" #include "opentelemetry/sdk_config.h" -#include "opentelemetry/version.h" + +#include OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/meter_provider.cc b/sdk/src/metrics/meter_provider.cc index 051ee7269e..1e9dc5f434 100644 --- a/sdk/src/metrics/meter_provider.cc +++ b/sdk/src/metrics/meter_provider.cc @@ -3,6 +3,8 @@ #include "opentelemetry/sdk/metrics/meter_provider.h" #include "opentelemetry/metrics/meter.h" +#include "opentelemetry/sdk/metrics/meter.h" +#include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/metrics/metric_reader.h" #include "opentelemetry/sdk/common/global_log_handler.h" diff --git a/sdk/src/metrics/metric_reader.cc b/sdk/src/metrics/metric_reader.cc index a778f0c41c..8b1998fbd3 100644 --- a/sdk/src/metrics/metric_reader.cc +++ b/sdk/src/metrics/metric_reader.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/sdk/metrics/metric_reader.h" +#include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/export/metric_producer.h" #include diff --git a/sdk/src/metrics/state/temporal_metric_storage.cc b/sdk/src/metrics/state/temporal_metric_storage.cc index 148588ad54..f988551108 100644 --- a/sdk/src/metrics/state/temporal_metric_storage.cc +++ b/sdk/src/metrics/state/temporal_metric_storage.cc @@ -1,14 +1,16 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include -#include -#include -#include "opentelemetry/nostd/shared_ptr.h" - +#include "opentelemetry/sdk/metrics/state/temporal_metric_storage.h" +#include "opentelemetry/common/spin_lock_mutex.h" #include "opentelemetry/metrics/meter.h" #include "opentelemetry/sdk/metrics/aggregation/default_aggregation.h" -#include "opentelemetry/sdk/metrics/state/temporal_metric_storage.h" +#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" +#include "opentelemetry/sdk/metrics/state/metric_collector.h" + +#include +#include +#include OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/resource/resource.cc b/sdk/src/resource/resource.cc index f71e17a8a7..12f8e16d43 100644 --- a/sdk/src/resource/resource.cc +++ b/sdk/src/resource/resource.cc @@ -5,6 +5,7 @@ #include "opentelemetry/nostd/span.h" #include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" +#include "opentelemetry/sdk/version/version.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/resource/resource_detector.cc b/sdk/src/resource/resource_detector.cc index f5c856f088..82e47a71ad 100644 --- a/sdk/src/resource/resource_detector.cc +++ b/sdk/src/resource/resource_detector.cc @@ -5,6 +5,9 @@ #include "opentelemetry/sdk/common/env_variables.h" #include "opentelemetry/sdk/resource/resource.h" +#include +#include + OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/src/trace/batch_span_processor.cc b/sdk/src/trace/batch_span_processor.cc index da9f39f054..dd69eaa68f 100644 --- a/sdk/src/trace/batch_span_processor.cc +++ b/sdk/src/trace/batch_span_processor.cc @@ -3,9 +3,14 @@ #include "opentelemetry/sdk/trace/batch_span_processor.h" #include "opentelemetry/common/spin_lock_mutex.h" +#include "opentelemetry/common/timestamp.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/trace/batch_span_processor_options.h" +#include "opentelemetry/sdk/trace/exporter.h" +#include "opentelemetry/sdk/trace/recordable.h" #include + using opentelemetry::sdk::common::AtomicUniquePtr; using opentelemetry::sdk::common::CircularBuffer; using opentelemetry::sdk::common::CircularBufferRange; diff --git a/sdk/src/trace/samplers/parent.cc b/sdk/src/trace/samplers/parent.cc index 3aa6b4a455..990e1a954a 100644 --- a/sdk/src/trace/samplers/parent.cc +++ b/sdk/src/trace/samplers/parent.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/sdk/trace/samplers/parent.h" +#include "opentelemetry/trace/span_context.h" namespace trace_api = opentelemetry::trace; diff --git a/sdk/src/trace/span.cc b/sdk/src/trace/span.cc index 138c966af3..c7524d43aa 100644 --- a/sdk/src/trace/span.cc +++ b/sdk/src/trace/span.cc @@ -5,6 +5,8 @@ #include "src/common/random.h" #include "opentelemetry/context/runtime_context.h" +#include "opentelemetry/sdk/trace/recordable.h" +#include "opentelemetry/trace/span_metadata.h" #include "opentelemetry/trace/trace_flags.h" #include "opentelemetry/version.h" @@ -48,10 +50,10 @@ SteadyTimestamp NowOr(const SteadyTimestamp &steady) Span::Span(std::shared_ptr &&tracer, nostd::string_view name, const common::KeyValueIterable &attributes, - const trace_api::SpanContextKeyValueIterable &links, - const trace_api::StartSpanOptions &options, - const trace_api::SpanContext &parent_span_context, - std::unique_ptr span_context) noexcept + const opentelemetry::trace::SpanContextKeyValueIterable &links, + const opentelemetry::trace::StartSpanOptions &options, + const opentelemetry::trace::SpanContext &parent_span_context, + std::unique_ptr span_context) noexcept : tracer_{std::move(tracer)}, recordable_{tracer_->GetProcessor().MakeRecordable()}, start_steady_time{options.start_steady_time}, @@ -66,7 +68,7 @@ Span::Span(std::shared_ptr &&tracer, recordable_->SetInstrumentationScope(tracer_->GetInstrumentationScope()); recordable_->SetIdentity(*span_context_, parent_span_context.IsValid() ? parent_span_context.span_id() - : trace_api::SpanId()); + : opentelemetry::trace::SpanId()); attributes.ForEachKeyValue([&](nostd::string_view key, common::AttributeValue value) noexcept { recordable_->SetAttribute(key, value); @@ -164,7 +166,7 @@ void Span::UpdateName(nostd::string_view name) noexcept recordable_->SetName(name); } -void Span::End(const trace_api::EndSpanOptions &options) noexcept +void Span::End(const opentelemetry::trace::EndSpanOptions &options) noexcept { std::lock_guard lock_guard{mu_}; diff --git a/sdk/src/trace/tracer.cc b/sdk/src/trace/tracer.cc index 07fd36d5b7..6ca7b37df5 100644 --- a/sdk/src/trace/tracer.cc +++ b/sdk/src/trace/tracer.cc @@ -3,13 +3,10 @@ #include "opentelemetry/sdk/trace/tracer.h" #include "opentelemetry/context/runtime_context.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/atomic_shared_ptr.h" #include "opentelemetry/trace/context.h" -#include "opentelemetry/version.h" -#include "src/trace/span.h" +#include "opentelemetry/trace/noop.h" -#include +#include "src/trace/span.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk @@ -17,21 +14,21 @@ namespace sdk namespace trace { -Tracer::Tracer(std::shared_ptr context, +Tracer::Tracer(std::shared_ptr context, std::unique_ptr instrumentation_scope) noexcept : instrumentation_scope_{std::move(instrumentation_scope)}, context_{context} {} -nostd::shared_ptr Tracer::StartSpan( +nostd::shared_ptr Tracer::StartSpan( nostd::string_view name, const opentelemetry::common::KeyValueIterable &attributes, - const trace_api::SpanContextKeyValueIterable &links, - const trace_api::StartSpanOptions &options) noexcept + const opentelemetry::trace::SpanContextKeyValueIterable &links, + const opentelemetry::trace::StartSpanOptions &options) noexcept { - trace_api::SpanContext parent_context = GetCurrentSpan()->GetContext(); - if (nostd::holds_alternative(options.parent)) + opentelemetry::trace::SpanContext parent_context = GetCurrentSpan()->GetContext(); + if (nostd::holds_alternative(options.parent)) { - auto span_context = nostd::get(options.parent); + auto span_context = nostd::get(options.parent); if (span_context.IsValid()) { parent_context = span_context; @@ -48,9 +45,9 @@ nostd::shared_ptr Tracer::StartSpan( } } - trace_api::TraceId trace_id; - trace_api::SpanId span_id = GetIdGenerator().GenerateSpanId(); - bool is_parent_span_valid = false; + opentelemetry::trace::TraceId trace_id; + opentelemetry::trace::SpanId span_id = GetIdGenerator().GenerateSpanId(); + bool is_parent_span_valid = false; if (parent_context.IsValid()) { @@ -64,28 +61,32 @@ nostd::shared_ptr Tracer::StartSpan( auto sampling_result = context_->GetSampler().ShouldSample(parent_context, trace_id, name, options.kind, attributes, links); - auto trace_flags = sampling_result.IsSampled() - ? trace_api::TraceFlags{trace_api::TraceFlags::kIsSampled} - : trace_api::TraceFlags{}; - - auto span_context = std::unique_ptr(new trace_api::SpanContext( - trace_id, span_id, trace_flags, false, - sampling_result.trace_state ? sampling_result.trace_state - : is_parent_span_valid ? parent_context.trace_state() - : trace_api::TraceState::GetDefault())); + auto trace_flags = + sampling_result.IsSampled() + ? opentelemetry::trace::TraceFlags{opentelemetry::trace::TraceFlags::kIsSampled} + : opentelemetry::trace::TraceFlags{}; + + auto span_context = + std::unique_ptr(new opentelemetry::trace::SpanContext( + trace_id, span_id, trace_flags, false, + sampling_result.trace_state + ? sampling_result.trace_state + : is_parent_span_valid ? parent_context.trace_state() + : opentelemetry::trace::TraceState::GetDefault())); if (!sampling_result.IsRecording()) { // create no-op span with valid span-context. - auto noop_span = nostd::shared_ptr{ - new (std::nothrow) trace_api::NoopSpan(this->shared_from_this(), std::move(span_context))}; + auto noop_span = nostd::shared_ptr{ + new (std::nothrow) + opentelemetry::trace::NoopSpan(this->shared_from_this(), std::move(span_context))}; return noop_span; } else { - auto span = nostd::shared_ptr{ + auto span = nostd::shared_ptr{ new (std::nothrow) Span{this->shared_from_this(), name, attributes, links, options, parent_context, std::move(span_context)}}; diff --git a/sdk/src/trace/tracer_provider.cc b/sdk/src/trace/tracer_provider.cc index b5eed6312f..7ac66ed6db 100644 --- a/sdk/src/trace/tracer_provider.cc +++ b/sdk/src/trace/tracer_provider.cc @@ -3,6 +3,9 @@ #include "opentelemetry/sdk/trace/tracer_provider.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/trace/processor.h" +#include "opentelemetry/sdk/trace/tracer.h" +#include "opentelemetry/sdk/trace/tracer_context.h" #include "opentelemetry/sdk_config.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/trace/tracer_provider_factory.cc b/sdk/src/trace/tracer_provider_factory.cc index df25694781..158ae949ea 100644 --- a/sdk/src/trace/tracer_provider_factory.cc +++ b/sdk/src/trace/tracer_provider_factory.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/sdk/trace/tracer_provider_factory.h" +#include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/random_id_generator_factory.h" #include "opentelemetry/sdk/trace/samplers/always_on_factory.h" #include "opentelemetry/sdk/trace/tracer_provider.h" diff --git a/sdk/test/logs/log_record_test.cc b/sdk/test/logs/log_record_test.cc index cce81d9910..0e5de03050 100644 --- a/sdk/test/logs/log_record_test.cc +++ b/sdk/test/logs/log_record_test.cc @@ -12,6 +12,7 @@ # include "opentelemetry/logs/provider.h" # include "opentelemetry/nostd/variant.h" # include "opentelemetry/sdk/logs/read_write_log_record.h" +# include "opentelemetry/sdk/resource/resource.h" # include "opentelemetry/trace/span_id.h" # include "opentelemetry/trace/trace_id.h" diff --git a/sdk/test/logs/logger_provider_sdk_test.cc b/sdk/test/logs/logger_provider_sdk_test.cc index 510f02b4df..e9bc897745 100644 --- a/sdk/test/logs/logger_provider_sdk_test.cc +++ b/sdk/test/logs/logger_provider_sdk_test.cc @@ -10,6 +10,7 @@ # include "opentelemetry/nostd/shared_ptr.h" # include "opentelemetry/nostd/string_view.h" # include "opentelemetry/sdk/logs/event_logger_provider_factory.h" +# include "opentelemetry/sdk/logs/exporter.h" # include "opentelemetry/sdk/logs/logger.h" # include "opentelemetry/sdk/logs/logger_provider.h" # include "opentelemetry/sdk/logs/recordable.h" diff --git a/sdk/test/logs/logger_sdk_test.cc b/sdk/test/logs/logger_sdk_test.cc index 0e5050a973..66f9edb8c5 100644 --- a/sdk/test/logs/logger_sdk_test.cc +++ b/sdk/test/logs/logger_sdk_test.cc @@ -6,12 +6,16 @@ # include # include +# include "opentelemetry/logs/logger_provider.h" # include "opentelemetry/nostd/string_view.h" -# include "opentelemetry/nostd/variant.h" # include "opentelemetry/sdk/logs/event_logger.h" # include "opentelemetry/sdk/logs/event_logger_provider.h" # include "opentelemetry/sdk/logs/logger.h" +# include "opentelemetry/sdk/logs/logger_provider.h" +# include "opentelemetry/sdk/logs/processor.h" # include "opentelemetry/sdk/logs/recordable.h" +# include "opentelemetry/sdk/trace/processor.h" +# include "opentelemetry/sdk/trace/tracer_provider.h" # include "opentelemetry/sdk/trace/tracer_provider_factory.h" # include "opentelemetry/trace/scope.h" # include "opentelemetry/trace/tracer.h" diff --git a/sdk/test/metrics/aggregation_test.cc b/sdk/test/metrics/aggregation_test.cc index 9f307cb015..94e5f4c1fa 100644 --- a/sdk/test/metrics/aggregation_test.cc +++ b/sdk/test/metrics/aggregation_test.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include "opentelemetry/sdk/metrics/aggregation/aggregation_config.h" #include "opentelemetry/sdk/metrics/aggregation/histogram_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h" #include "opentelemetry/sdk/metrics/aggregation/sum_aggregation.h" diff --git a/sdk/test/metrics/async_instruments_test.cc b/sdk/test/metrics/async_instruments_test.cc index 87d0a441d5..10c0335559 100644 --- a/sdk/test/metrics/async_instruments_test.cc +++ b/sdk/test/metrics/async_instruments_test.cc @@ -3,6 +3,7 @@ #include "opentelemetry/sdk/metrics/async_instruments.h" #include "opentelemetry/sdk/metrics/state/multi_metric_storage.h" +#include "opentelemetry/sdk/metrics/state/observable_registry.h" #include diff --git a/sdk/test/metrics/attributes_hashmap_benchmark.cc b/sdk/test/metrics/attributes_hashmap_benchmark.cc index f0286ec09e..0568080a6d 100644 --- a/sdk/test/metrics/attributes_hashmap_benchmark.cc +++ b/sdk/test/metrics/attributes_hashmap_benchmark.cc @@ -9,6 +9,8 @@ #include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" #include +#include +#include #include using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/exemplar/always_sample_filter_test.cc b/sdk/test/metrics/exemplar/always_sample_filter_test.cc index cd9e58f284..30c86fd37f 100644 --- a/sdk/test/metrics/exemplar/always_sample_filter_test.cc +++ b/sdk/test/metrics/exemplar/always_sample_filter_test.cc @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 #include + +#include "opentelemetry/context/context.h" #include "opentelemetry/sdk/metrics/exemplar/filter.h" using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/multi_metric_storage_test.cc b/sdk/test/metrics/multi_metric_storage_test.cc index 1c230bafcf..e7e4151f09 100644 --- a/sdk/test/metrics/multi_metric_storage_test.cc +++ b/sdk/test/metrics/multi_metric_storage_test.cc @@ -9,7 +9,6 @@ #include using namespace opentelemetry; -using namespace opentelemetry::sdk::instrumentationscope; using namespace opentelemetry::sdk::metrics; class TestMetricStorage : public SyncWritableMetricStorage diff --git a/sdk/test/resource/resource_test.cc b/sdk/test/resource/resource_test.cc index 803d5666d9..96de75c04a 100644 --- a/sdk/test/resource/resource_test.cc +++ b/sdk/test/resource/resource_test.cc @@ -2,15 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/common/key_value_iterable_view.h" -#include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/resource/semantic_conventions.h" +#include "opentelemetry/sdk/version/version.h" #include +#include #include -#include #include diff --git a/sdk/test/trace/batch_span_processor_test.cc b/sdk/test/trace/batch_span_processor_test.cc index b7a6558538..411b4dacfe 100644 --- a/sdk/test/trace/batch_span_processor_test.cc +++ b/sdk/test/trace/batch_span_processor_test.cc @@ -2,11 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/sdk/trace/batch_span_processor.h" +#include "opentelemetry/sdk/common/exporter_utils.h" #include "opentelemetry/sdk/common/global_log_handler.h" +#include "opentelemetry/sdk/trace/batch_span_processor_options.h" +#include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/span_data.h" #include "opentelemetry/sdk/trace/tracer.h" #include + #include #include #include diff --git a/sdk/test/trace/sampler_benchmark.cc b/sdk/test/trace/sampler_benchmark.cc index 17999dcf26..42de190980 100644 --- a/sdk/test/trace/sampler_benchmark.cc +++ b/sdk/test/trace/sampler_benchmark.cc @@ -69,11 +69,13 @@ void BenchmarkShouldSampler(Sampler &sampler, benchmark::State &state) using M = std::map; M m1 = {{}}; - using L = std::vector>>; - L l1 = {{trace_api::SpanContext(false, false), {}}, {trace_api::SpanContext(false, false), {}}}; + using L = + std::vector>>; + L l1 = {{opentelemetry::trace::SpanContext(false, false), {}}, + {opentelemetry::trace::SpanContext(false, false), {}}}; opentelemetry::common::KeyValueIterableView view{m1}; - trace_api::SpanContextKeyValueIterableView links{l1}; + opentelemetry::trace::SpanContextKeyValueIterableView links{l1}; while (state.KeepRunning()) { diff --git a/sdk/test/trace/tracer_test.cc b/sdk/test/trace/tracer_test.cc index f92c0f6e93..45b5fc010f 100644 --- a/sdk/test/trace/tracer_test.cc +++ b/sdk/test/trace/tracer_test.cc @@ -17,8 +17,9 @@ using namespace opentelemetry::sdk::trace; using namespace opentelemetry::sdk::resource; using opentelemetry::common::SteadyTimestamp; using opentelemetry::common::SystemTimestamp; -namespace nostd = opentelemetry::nostd; -namespace common = opentelemetry::common; +namespace nostd = opentelemetry::nostd; +namespace common = opentelemetry::common; +namespace trace_api = opentelemetry::trace; using opentelemetry::common::KeyValueIterableView; using opentelemetry::exporter::memory::InMemorySpanData; using opentelemetry::exporter::memory::InMemorySpanExporter; From bbe9ddf4cfef7b1791013dbf5e56686a0d29e5f7 Mon Sep 17 00:00:00 2001 From: Cengizhan Pasaoglu Date: Tue, 13 Jun 2023 15:01:15 +0200 Subject: [PATCH 2/2] Include a few header files additionally after code review comments --- examples/jaeger/main.cc | 1 + examples/otlp/grpc_log_main.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/examples/jaeger/main.cc b/examples/jaeger/main.cc index 1b60eaed2a..a5b3c38c35 100644 --- a/examples/jaeger/main.cc +++ b/examples/jaeger/main.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "opentelemetry/exporters/jaeger/jaeger_exporter_factory.h" +#include "opentelemetry/sdk/trace/exporter.h" #include "opentelemetry/sdk/trace/processor.h" #include "opentelemetry/sdk/trace/simple_processor_factory.h" #include "opentelemetry/sdk/trace/tracer_provider_factory.h" diff --git a/examples/otlp/grpc_log_main.cc b/examples/otlp/grpc_log_main.cc index ffd4376ebf..f6f6685922 100644 --- a/examples/otlp/grpc_log_main.cc +++ b/examples/otlp/grpc_log_main.cc @@ -5,9 +5,11 @@ # include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h" # include "opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_factory.h" # include "opentelemetry/logs/provider.h" +# include "opentelemetry/sdk/logs/exporter.h" # include "opentelemetry/sdk/logs/logger_provider_factory.h" # include "opentelemetry/sdk/logs/processor.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/simple_processor_factory.h" # include "opentelemetry/sdk/trace/tracer_provider_factory.h"