| 155 | } |
| 156 | |
| 157 | nostd::shared_ptr<sdktrace::TracerProvider> InitializeSdkTracerProvider() { |
| 158 | // Bind the lifetime of the OT runtime context to the CPU and I/O thread |
| 159 | // pools. This will keep OT alive until all thread tasks have finished. |
| 160 | internal::GetCpuThreadPool()->KeepAlive(GetStorageSingleton()); |
| 161 | io::default_io_context().executor()->KeepAlive(GetStorageSingleton()); |
| 162 | auto exporter = InitializeExporter(); |
| 163 | if (exporter) { |
| 164 | sdktrace::BatchSpanProcessorOptions options; |
| 165 | options.max_queue_size = 16384; |
| 166 | options.schedule_delay_millis = std::chrono::milliseconds(500); |
| 167 | options.max_export_batch_size = 16384; |
| 168 | auto processor = |
| 169 | std::make_unique<ThreadIdSpanProcessor>(std::move(exporter), options); |
| 170 | return std::make_shared<sdktrace::TracerProvider>(std::move(processor)); |
| 171 | } |
| 172 | return nostd::shared_ptr<sdktrace::TracerProvider>(); |
| 173 | } |
| 174 | |
| 175 | class FlushLog { |
| 176 | public: |
no test coverage detected