MCPcopy Create free account
hub / github.com/apache/arrow / SetupOTel

Function SetupOTel

cpp/src/arrow/flight/sql/test_server_cli.cc:45–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44#ifdef ARROW_WITH_OPENTELEMETRY
45arrow::Status SetupOTel() {
46 auto tracer = arrow::internal::tracing::GetTracer();
47 ARROW_UNUSED(tracer);
48
49 opentelemetry::context::propagation::GlobalTextMapPropagator::SetGlobalPropagator(
50 opentelemetry::nostd::shared_ptr<
51 opentelemetry::context::propagation::TextMapPropagator>(
52 new opentelemetry::trace::propagation::HttpTraceContext()));
53
54 ARROW_RETURN_NOT_OK(arrow::telemetry::internal::InitializeOtelLoggerProvider());
55
56 auto logging_options = arrow::telemetry::OtelLoggingOptions::Defaults();
57 logging_options.severity_threshold = arrow::telemetry::LogLevel::ARROW_TRACE;
58 // Flush after every log message
59 logging_options.flush_severity = arrow::telemetry::LogLevel::ARROW_TRACE;
60 ARROW_RETURN_NOT_OK(arrow::flight::RegisterFlightOtelLoggers(logging_options));
61
62 return arrow::Status::OK();
63}
64#endif
65
66arrow::Status RunMain() {

Callers 1

RunMainFunction · 0.85

Calls 5

GetTracerFunction · 0.85
DefaultsFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected