diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82e200fd35..17465af27d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -366,6 +366,22 @@ jobs: sudo ./ci/setup_grpc.sh ./ci/do_ci.sh cmake.do_not_install.test + cmake_otprotocol_shared_libs_with_static_grpc_test: + name: CMake test (build shared libraries with otlp-exporter and static gRPC) + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: setup + run: | + sudo ./ci/setup_cmake.sh + sudo ./ci/setup_ci_environment.sh + - name: run otlp exporter tests + run: | + sudo ./ci/setup_grpc.sh -T + ./ci/do_ci.sh cmake.exporter.otprotocol.shared_libs.with_static_grpc.test + plugin_test: name: Plugin -> CMake runs-on: ubuntu-latest diff --git a/bazel/repository.bzl b/bazel/repository.bzl index e03e48ae5a..847b8bb9d1 100644 --- a/bazel/repository.bzl +++ b/bazel/repository.bzl @@ -147,7 +147,10 @@ def opentelemetry_cpp_deps(): build_file = "@io_opentelemetry_cpp//bazel:curl.BUILD", sha256 = "ba98332752257b47b9dea6d8c0ad25ec1745c20424f1dd3ff2c99ab59e97cf91", strip_prefix = "curl-7.73.0", - urls = ["https://curl.haxx.se/download/curl-7.73.0.tar.gz"], + urls = [ + "https://curl.haxx.se/download/curl-7.73.0.tar.gz", + "https://github.com/curl/curl/releases/download/curl-7_73_0/curl-7.73.0.tar.gz", + ], ) # libthrift (optional) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 19695d2cf6..64d3b72308 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -243,6 +243,20 @@ elif [[ "$1" == "cmake.exporter.otprotocol.test" ]]; then make -j $(nproc) cd exporters/otlp && make test exit 0 +elif [[ "$1" == "cmake.exporter.otprotocol.shared_libs.with_static_grpc.test" ]]; then + cd "${BUILD_DIR}" + rm -rf * + cmake -DCMAKE_BUILD_TYPE=Debug \ + -DWITH_OTLP=ON \ + -DWITH_OTLP_HTTP=ON \ + -DBUILD_SHARED_LIBS=ON \ + "${SRC_DIR}" + grpc_cpp_plugin=`which grpc_cpp_plugin` + proto_make_file="CMakeFiles/opentelemetry_proto.dir/build.make" + sed -i "s~gRPC_CPP_PLUGIN_EXECUTABLE-NOTFOUND~$grpc_cpp_plugin~" ${proto_make_file} #fixme + make -j $(nproc) + cd exporters/otlp && make test + exit 0 elif [[ "$1" == "cmake.exporter.otprotocol.with_async_export.test" ]]; then cd "${BUILD_DIR}" rm -rf * diff --git a/ci/setup_grpc.sh b/ci/setup_grpc.sh index d6e92d4ea6..e1002b6616 100755 --- a/ci/setup_grpc.sh +++ b/ci/setup_grpc.sh @@ -10,11 +10,11 @@ new_grpc_version='v1.49.2' gcc_version_for_new_grpc='5.1' std_version='14' install_grpc_version=${new_grpc_version} -grpc_version='v1.39.0' install_dir='/usr/local/' +build_shared_libs='' usage() { echo "Usage: $0 [-v ] [-i "] 1>&2; exit 1;} -while getopts ":v:i:r:s:" o; do +while getopts ":v:i:r:s:TH" o; do case "${o}" in v) gcc_version=${OPTARG} @@ -28,6 +28,12 @@ while getopts ":v:i:r:s:" o; do s) std_version=${OPTARG} ;; + T) + build_shared_libs="OFF" + ;; + H) + build_shared_libs="ON" + ;; *) usage ;; @@ -54,19 +60,34 @@ pushd grpc git submodule init git submodule update --depth 1 mkdir -p "third_party/abseil-cpp/build" && pushd "third_party/abseil-cpp/build" -cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ - -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR .. -make -j${nproc} install && popd +set -x + +ABSEIL_CPP_BUILD_OPTIONS=( + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE + -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR +) +if [ ! -z "$build_shared_libs" ]; then + ABSEIL_CPP_BUILD_OPTIONS=(${ABSEIL_CPP_BUILD_OPTIONS[@]} "-DBUILD_SHARED_LIBS=$build_shared_libs") +fi +cmake ${ABSEIL_CPP_BUILD_OPTIONS[@]} .. +cmake --build . -j${nproc} --target install && popd mkdir -p build && pushd build -cmake -DgRPC_INSTALL=ON \ - -DCMAKE_CXX_STANDARD=${std_version} \ - -DgRPC_BUILD_TESTS=OFF \ - -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \ - -DCMAKE_PREFIX_PATH=$INSTALL_DIR \ - .. -make -j $(nproc) -make install + +GRPC_BUILD_OPTIONS=( + -DgRPC_INSTALL=ON + -DCMAKE_CXX_STANDARD=${std_version} + -DgRPC_BUILD_TESTS=OFF + -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR + -DCMAKE_PREFIX_PATH=$INSTALL_DIR +) +if [ ! -z "$build_shared_libs" ]; then + GRPC_BUILD_OPTIONS=(${GRPC_BUILD_OPTIONS[@]} "-DBUILD_SHARED_LIBS=$build_shared_libs") +fi + +cmake ${GRPC_BUILD_OPTIONS[@]} .. +cmake --build . -j$(nproc) +cmake --install . popd popd diff --git a/exporters/otlp/BUILD b/exporters/otlp/BUILD index 98ae13ebb1..01dc83f00b 100644 --- a/exporters/otlp/BUILD +++ b/exporters/otlp/BUILD @@ -61,6 +61,9 @@ cc_library( "//sdk/src/common:global_log_handler", "@com_github_grpc_grpc//:grpc++", "@com_github_opentelemetry_proto//:common_proto_cc", + "@com_github_opentelemetry_proto//:logs_service_grpc_cc", + "@com_github_opentelemetry_proto//:metrics_service_grpc_cc", + "@com_github_opentelemetry_proto//:trace_service_grpc_cc", ], ) @@ -268,7 +271,6 @@ cc_library( ":otlp_grpc_client", "//ext:headers", "//sdk/src/logs", - "@com_github_opentelemetry_proto//:logs_service_proto_cc", # For gRPC "@com_github_opentelemetry_proto//:logs_service_grpc_cc", ], @@ -407,6 +409,7 @@ cc_test( "test", ], deps = [ + ":otlp_grpc_exporter", ":otlp_grpc_log_record_exporter", "//api", "//sdk/src/logs", diff --git a/exporters/otlp/CMakeLists.txt b/exporters/otlp/CMakeLists.txt index 585e253939..eed80783ac 100644 --- a/exporters/otlp/CMakeLists.txt +++ b/exporters/otlp/CMakeLists.txt @@ -249,9 +249,14 @@ if(BUILD_TESTING) add_executable(otlp_grpc_log_record_exporter_test test/otlp_grpc_log_record_exporter_test.cc) target_link_libraries( - otlp_grpc_log_record_exporter_test ${GTEST_BOTH_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} ${GMOCK_LIB} - opentelemetry_exporter_otlp_grpc_log opentelemetry_logs) + otlp_grpc_log_record_exporter_test + ${GTEST_BOTH_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} + ${GMOCK_LIB} + opentelemetry_exporter_otlp_grpc + opentelemetry_exporter_otlp_grpc_log + opentelemetry_trace + opentelemetry_logs) gtest_add_tests( TARGET otlp_grpc_log_record_exporter_test TEST_PREFIX exporter.otlp. diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client.h index 4ac2c4fe01..75defd6b42 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client.h @@ -9,6 +9,17 @@ #include "opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h" +#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" + +#include "opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.h" +#include "opentelemetry/proto/collector/trace/v1/trace_service.grpc.pb.h" + +#ifdef ENABLE_LOGS_PREVIEW +# include "opentelemetry/proto/collector/logs/v1/logs_service.grpc.pb.h" +#endif + +#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" + OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter { @@ -33,14 +44,49 @@ class OtlpGrpcClient const OtlpGrpcExporterOptions &options); /** - * Create service stub to communicate with the OpenTelemetry Collector. + * Create gRPC CompletionQueue to async call RPC. + */ + static std::unique_ptr MakeCompletionQueue(); + + /** + * Create trace service stub to communicate with the OpenTelemetry Collector. + */ + static std::unique_ptr + MakeTraceServiceStub(const OtlpGrpcExporterOptions &options); + + /** + * Create metrics service stub to communicate with the OpenTelemetry Collector. + */ + static std::unique_ptr + MakeMetricsServiceStub(const OtlpGrpcExporterOptions &options); + +#ifdef ENABLE_LOGS_PREVIEW + /** + * Create logs service stub to communicate with the OpenTelemetry Collector. */ - template - static std::unique_ptr MakeServiceStub( - const OtlpGrpcExporterOptions &options) - { - return ServiceType::NewStub(MakeChannel(options)); - } + static std::unique_ptr + MakeLogsServiceStub(const OtlpGrpcExporterOptions &options); +#endif + + static grpc::Status DelegateExport( + proto::collector::trace::v1::TraceService::StubInterface *stub, + grpc::ClientContext *context, + const proto::collector::trace::v1::ExportTraceServiceRequest &request, + proto::collector::trace::v1::ExportTraceServiceResponse *response); + + static grpc::Status DelegateExport( + proto::collector::metrics::v1::MetricsService::StubInterface *stub, + grpc::ClientContext *context, + const proto::collector::metrics::v1::ExportMetricsServiceRequest &request, + proto::collector::metrics::v1::ExportMetricsServiceResponse *response); + +#ifdef ENABLE_LOGS_PREVIEW + static grpc::Status DelegateExport( + proto::collector::logs::v1::LogsService::StubInterface *stub, + grpc::ClientContext *context, + const proto::collector::logs::v1::ExportLogsServiceRequest &request, + proto::collector::logs::v1::ExportLogsServiceResponse *response); +#endif }; } // namespace otlp } // namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h index ab64d7e769..7aff1e24a5 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h @@ -75,6 +75,7 @@ class OtlpGrpcExporter final : public opentelemetry::sdk::trace::SpanExporter // For testing friend class OtlpGrpcExporterTestPeer; + friend class OtlpGrpcLogRecordExporterTestPeer; // Store service stub internally. Useful for testing. std::unique_ptr trace_service_stub_; diff --git a/exporters/otlp/src/otlp_grpc_client.cc b/exporters/otlp/src/otlp_grpc_client.cc index 158f276000..9250f87cc4 100644 --- a/exporters/otlp/src/otlp_grpc_client.cc +++ b/exporters/otlp/src/otlp_grpc_client.cc @@ -103,6 +103,60 @@ std::unique_ptr OtlpGrpcClient::MakeClientContext( return context; } +std::unique_ptr OtlpGrpcClient::MakeCompletionQueue() +{ + return std::unique_ptr(new grpc::CompletionQueue()); +} + +std::unique_ptr +OtlpGrpcClient::MakeTraceServiceStub(const OtlpGrpcExporterOptions &options) +{ + return proto::collector::trace::v1::TraceService::NewStub(MakeChannel(options)); +} + +std::unique_ptr +OtlpGrpcClient::MakeMetricsServiceStub(const OtlpGrpcExporterOptions &options) +{ + return proto::collector::metrics::v1::MetricsService::NewStub(MakeChannel(options)); +} + +#ifdef ENABLE_LOGS_PREVIEW +std::unique_ptr +OtlpGrpcClient::MakeLogsServiceStub(const OtlpGrpcExporterOptions &options) +{ + return proto::collector::logs::v1::LogsService::NewStub(MakeChannel(options)); +} +#endif + +grpc::Status OtlpGrpcClient::DelegateExport( + proto::collector::trace::v1::TraceService::StubInterface *stub, + grpc::ClientContext *context, + const proto::collector::trace::v1::ExportTraceServiceRequest &request, + proto::collector::trace::v1::ExportTraceServiceResponse *response) +{ + return stub->Export(context, request, response); +} + +grpc::Status OtlpGrpcClient::DelegateExport( + proto::collector::metrics::v1::MetricsService::StubInterface *stub, + grpc::ClientContext *context, + const proto::collector::metrics::v1::ExportMetricsServiceRequest &request, + proto::collector::metrics::v1::ExportMetricsServiceResponse *response) +{ + return stub->Export(context, request, response); +} + +#ifdef ENABLE_LOGS_PREVIEW +grpc::Status OtlpGrpcClient::DelegateExport( + proto::collector::logs::v1::LogsService::StubInterface *stub, + grpc::ClientContext *context, + const proto::collector::logs::v1::ExportLogsServiceRequest &request, + proto::collector::logs::v1::ExportLogsServiceResponse *response) +{ + return stub->Export(context, request, response); +} +#endif + } // namespace otlp } // namespace exporter OPENTELEMETRY_END_NAMESPACE diff --git a/exporters/otlp/src/otlp_grpc_exporter.cc b/exporters/otlp/src/otlp_grpc_exporter.cc index 89ad1fb2cf..30a9b63fe4 100644 --- a/exporters/otlp/src/otlp_grpc_exporter.cc +++ b/exporters/otlp/src/otlp_grpc_exporter.cc @@ -23,9 +23,7 @@ namespace otlp OtlpGrpcExporter::OtlpGrpcExporter() : OtlpGrpcExporter(OtlpGrpcExporterOptions()) {} OtlpGrpcExporter::OtlpGrpcExporter(const OtlpGrpcExporterOptions &options) - : options_(options), - trace_service_stub_( - OtlpGrpcClient::MakeServiceStub(options)) + : options_(options), trace_service_stub_(OtlpGrpcClient::MakeTraceServiceStub(options)) {} OtlpGrpcExporter::OtlpGrpcExporter( @@ -60,7 +58,8 @@ sdk::common::ExportResult OtlpGrpcExporter::Export( auto context = OtlpGrpcClient::MakeClientContext(options_); proto::collector::trace::v1::ExportTraceServiceResponse response; - grpc::Status status = trace_service_stub_->Export(context.get(), request, &response); + grpc::Status status = + OtlpGrpcClient::DelegateExport(trace_service_stub_.get(), context.get(), request, &response); if (!status.ok()) { diff --git a/exporters/otlp/src/otlp_grpc_log_record_exporter.cc b/exporters/otlp/src/otlp_grpc_log_record_exporter.cc index 1873ac8ad7..6cef1d07b6 100644 --- a/exporters/otlp/src/otlp_grpc_log_record_exporter.cc +++ b/exporters/otlp/src/otlp_grpc_log_record_exporter.cc @@ -36,9 +36,7 @@ OtlpGrpcLogRecordExporter::OtlpGrpcLogRecordExporter() {} OtlpGrpcLogRecordExporter::OtlpGrpcLogRecordExporter(const OtlpGrpcExporterOptions &options) - : options_(options), - log_service_stub_( - OtlpGrpcClient::MakeServiceStub(options)) + : options_(options), log_service_stub_(OtlpGrpcClient::MakeLogsServiceStub(options)) {} OtlpGrpcLogRecordExporter::OtlpGrpcLogRecordExporter( @@ -74,7 +72,8 @@ opentelemetry::sdk::common::ExportResult OtlpGrpcLogRecordExporter::Export( auto context = OtlpGrpcClient::MakeClientContext(options_); proto::collector::logs::v1::ExportLogsServiceResponse response; - grpc::Status status = log_service_stub_->Export(context.get(), request, &response); + grpc::Status status = + OtlpGrpcClient::DelegateExport(log_service_stub_.get(), context.get(), request, &response); if (!status.ok()) { diff --git a/exporters/otlp/src/otlp_grpc_metric_exporter.cc b/exporters/otlp/src/otlp_grpc_metric_exporter.cc index 3fd50e421b..fd503f9836 100644 --- a/exporters/otlp/src/otlp_grpc_metric_exporter.cc +++ b/exporters/otlp/src/otlp_grpc_metric_exporter.cc @@ -25,8 +25,7 @@ OtlpGrpcMetricExporter::OtlpGrpcMetricExporter(const OtlpGrpcMetricExporterOptio : options_(options), aggregation_temporality_selector_{ OtlpMetricUtils::ChooseTemporalitySelector(options_.aggregation_temporality)}, - metrics_service_stub_( - OtlpGrpcClient::MakeServiceStub(options)) + metrics_service_stub_(OtlpGrpcClient::MakeMetricsServiceStub(options)) {} OtlpGrpcMetricExporter::OtlpGrpcMetricExporter( @@ -67,7 +66,8 @@ opentelemetry::sdk::common::ExportResult OtlpGrpcMetricExporter::Export( auto context = OtlpGrpcClient::MakeClientContext(options_); proto::collector::metrics::v1::ExportMetricsServiceResponse response; - grpc::Status status = metrics_service_stub_->Export(context.get(), request, &response); + grpc::Status status = OtlpGrpcClient::DelegateExport(metrics_service_stub_.get(), context.get(), + request, &response); if (!status.ok()) { 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 450bebc218..a0455adb70 100644 --- a/exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc +++ b/exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc @@ -5,11 +5,13 @@ # include +# include "opentelemetry/exporters/otlp/otlp_grpc_exporter.h" # include "opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter.h" # include "opentelemetry/exporters/otlp/protobuf_include_prefix.h" # include "opentelemetry/proto/collector/logs/v1/logs_service_mock.grpc.pb.h" +# include "opentelemetry/proto/collector/trace/v1/trace_service_mock.grpc.pb.h" # include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" @@ -18,6 +20,10 @@ # include "opentelemetry/sdk/logs/exporter.h" # include "opentelemetry/sdk/logs/logger_provider.h" # include "opentelemetry/sdk/resource/resource.h" +# include "opentelemetry/sdk/trace/exporter.h" +# include "opentelemetry/sdk/trace/simple_processor_factory.h" +# include "opentelemetry/sdk/trace/tracer_provider_factory.h" +# include "opentelemetry/trace/provider.h" # include @@ -45,6 +51,13 @@ class OtlpGrpcLogRecordExporterTestPeer : public ::testing::Test new OtlpGrpcLogRecordExporter(std::move(stub_interface))); } + std::unique_ptr GetExporter( + std::unique_ptr &stub_interface) + { + return std::unique_ptr( + new OtlpGrpcExporter(std::move(stub_interface))); + } + // Get the options associated with the given exporter. const OtlpGrpcExporterOptions &GetOptions(std::unique_ptr &exporter) { @@ -135,29 +148,54 @@ TEST_F(OtlpGrpcLogRecordExporterTestPeer, ExportIntegrationTest) '3', '2', '1', '0'}; opentelemetry::trace::SpanId span_id{span_id_bin}; - const std::string schema_url{"https://opentelemetry.io/schemas/1.11.0"}; - auto logger = provider->GetLogger("test", "opentelelemtry_library", "", schema_url, true, - {{"scope_key1", "scope_value"}, {"scope_key2", 2}}); - std::unordered_map attributes; - attributes["service.name"] = "unit_test_service"; - attributes["tenant.id"] = "test_user"; - attributes["bool_value"] = true; - attributes["int32_value"] = static_cast(1); - attributes["uint32_value"] = static_cast(2); - attributes["int64_value"] = static_cast(0x1100000000LL); - attributes["uint64_value"] = static_cast(0x1200000000ULL); - attributes["double_value"] = static_cast(3.1); - attributes["vec_bool_value"] = attribute_storage_bool_value; - attributes["vec_int32_value"] = attribute_storage_int32_value; - attributes["vec_uint32_value"] = attribute_storage_uint32_value; - attributes["vec_int64_value"] = attribute_storage_int64_value; - attributes["vec_uint64_value"] = attribute_storage_uint64_value; - attributes["vec_double_value"] = attribute_storage_double_value; - attributes["vec_string_value"] = attribute_storage_string_value; - logger->EmitLogRecord( - opentelemetry::logs::Severity::kInfo, "Log message", attributes, trace_id, span_id, - opentelemetry::trace::TraceFlags{opentelemetry::trace::TraceFlags::kIsSampled}, - std::chrono::system_clock::now()); + auto trace_mock_stub = new proto::collector::trace::v1::MockTraceServiceStub(); + std::unique_ptr trace_stub_interface( + trace_mock_stub); + + auto trace_provider = opentelemetry::nostd::shared_ptr( + opentelemetry::sdk::trace::TracerProviderFactory::Create( + opentelemetry::sdk::trace::SimpleSpanProcessorFactory::Create( + GetExporter(trace_stub_interface)))); + + // Trace and Logs should both receive datas when links static gRPC on ELF ABI. + EXPECT_CALL(*trace_mock_stub, Export(_, _, _)) + .Times(AtLeast(1)) + .WillRepeatedly(Return(grpc::Status::OK)); + + { + const std::string schema_url{"https://opentelemetry.io/schemas/1.11.0"}; + + auto tracer = trace_provider->GetTracer("opentelelemtry_library", "", schema_url); + opentelemetry::trace::Provider::SetTracerProvider(std::move(trace_provider)); + auto trace_span = tracer->StartSpan("test_log"); + opentelemetry::trace::Scope trace_scope{trace_span}; + + auto logger = provider->GetLogger("test", "opentelelemtry_library", "", schema_url, true, + {{"scope_key1", "scope_value"}, {"scope_key2", 2}}); + std::unordered_map attributes; + attributes["service.name"] = "unit_test_service"; + attributes["tenant.id"] = "test_user"; + attributes["bool_value"] = true; + attributes["int32_value"] = static_cast(1); + attributes["uint32_value"] = static_cast(2); + attributes["int64_value"] = static_cast(0x1100000000LL); + attributes["uint64_value"] = static_cast(0x1200000000ULL); + attributes["double_value"] = static_cast(3.1); + attributes["vec_bool_value"] = attribute_storage_bool_value; + attributes["vec_int32_value"] = attribute_storage_int32_value; + attributes["vec_uint32_value"] = attribute_storage_uint32_value; + attributes["vec_int64_value"] = attribute_storage_int64_value; + attributes["vec_uint64_value"] = attribute_storage_uint64_value; + attributes["vec_double_value"] = attribute_storage_double_value; + attributes["vec_string_value"] = attribute_storage_string_value; + logger->EmitLogRecord(opentelemetry::logs::Severity::kInfo, "Log message", attributes, + trace_span->GetContext(), std::chrono::system_clock::now()); + } + + opentelemetry::trace::Provider::SetTracerProvider( + opentelemetry::nostd::shared_ptr( + new opentelemetry::trace::NoopTracerProvider())); + trace_provider = opentelemetry::nostd::shared_ptr(); } } // namespace otlp