-
Notifications
You must be signed in to change notification settings - Fork 559
Fix gRPC telemetry exporters #6558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,8 +16,9 @@ use anyhow::Context; | |
| use opentelemetry_otlp::{ | ||
| Protocol as OtlpWireProtocol, SpanExporter, WithExportConfig, WithHttpConfig, WithTonicConfig, | ||
| }; | ||
| use opentelemetry_sdk::trace::span_processor_with_async_runtime::BatchSpanProcessor; | ||
| use opentelemetry_sdk::trace::{BatchConfigBuilder, SdkTracerProvider}; | ||
| use opentelemetry_sdk::{Resource, trace}; | ||
| use opentelemetry_sdk::{Resource, runtime}; | ||
|
|
||
| use crate::otlp::{OtlpExporterConfig, OtlpProtocol}; | ||
|
|
||
|
|
@@ -43,13 +44,14 @@ impl OtlpProtocol { | |
| } | ||
| } | ||
|
|
||
| /// Builds the OTLP tracer provider. | ||
| pub(crate) fn init_tracer_provider( | ||
| otlp_config: &OtlpExporterConfig, | ||
| resource: Resource, | ||
| ) -> anyhow::Result<SdkTracerProvider> { | ||
| let traces_protocol = otlp_config.traces_protocol()?; | ||
| let span_exporter = traces_protocol.span_exporter()?; | ||
| let span_processor = trace::BatchSpanProcessor::builder(span_exporter) | ||
| let span_processor = BatchSpanProcessor::builder(span_exporter, runtime::Tokio) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With the processor spawned onto Useful? React with 👍 / 👎. |
||
| .with_batch_config( | ||
| BatchConfigBuilder::default() | ||
| // Quickwit can generate a lot of spans, especially in debug mode, and the | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
OTEL_EXPORTER_OTLP_PROTOCOLor a signal-specific protocol is set tohttp/protobuforhttp/json(both are accepted inconfig.rs), this crate still usesopentelemetry-otlp's default blocking reqwest HTTP client becausequickwit/Cargo.toml:192does not enablereqwest-clientorhyper-client. Moving this reader (and the analogous log/span processors) ontoruntime::Tokiotherefore runs blocking HTTP exports on Quickwit's main Tokio workers instead of the SDK dedicated thread; a slow or retrying collector can tie up runtime threads and degrade serving/indexing. Please keep the async-runtime path to gRPC or enable an async HTTP client for HTTP protocols.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trinity-1686a thoughts on this one?