pub struct OtelSink { /* private fields */ }Expand description
TelemetrySink that exports to OpenTelemetry providers.
Implementations§
Source§impl OtelSink
impl OtelSink
Sourcepub fn new(
tracer_provider: SdkTracerProvider,
meter_provider: SdkMeterProvider,
logger_provider: SdkLoggerProvider,
) -> Self
pub fn new( tracer_provider: SdkTracerProvider, meter_provider: SdkMeterProvider, logger_provider: SdkLoggerProvider, ) -> Self
Wrap already-built providers. This is the seam the tests use (with the
SDK’s in-memory exporters); OtelSink::from_config is the OTLP path.
Sourcepub fn from_config(cfg: &ObservabilityConfig) -> Result<Self, String>
pub fn from_config(cfg: &ObservabilityConfig) -> Result<Self, String>
Build the OTLP HTTP/protobuf export pipeline from config + OTEL env
fallbacks. Constructs a blocking HTTP client - call from a plain
thread, not a tokio runtime thread (crate::build_sink does this).
Sourcepub fn tracing_log_layer(&self) -> LogLayer
pub fn tracing_log_layer(&self) -> LogLayer
A tracing-subscriber layer that forwards the process’s own tracing
events into this sink’s OTLP logs pipeline (daemon-level log export).
These records correlate by resource attributes only - the daemon’s
tracing events fire outside any run’s spans, so they carry no trace
ids; the per-run TelemetryEvent::Log records are the correlated
ones. Filtered to INFO, with the OTel/HTTP stack’s own targets
silenced: an export failure that logged through this bridge would
otherwise generate more exports. The filtering is done inside
TargetFilteredBridge rather than Layer::with_filter because a
Filtered layer swapped into a reload slot after subscriber
construction has no registered FilterId and panics.
Trait Implementations§
Source§impl TelemetrySink for OtelSink
impl TelemetrySink for OtelSink
Source§fn emit(&self, event: TelemetryEvent)
fn emit(&self, event: TelemetryEvent)
Source§fn observe_lanes(&self, health: LaneHealth)
fn observe_lanes(&self, health: LaneHealth)
Source§fn observe_providers(&self, down: &[ProviderHealth])
fn observe_providers(&self, down: &[ProviderHealth])
TelemetrySink::observe_lanes. Default: ignore it,
so an existing sink keeps compiling unchanged.