Skip to main content

wyrd_runtime/
otel.rs

1//! OpenTelemetry wiring shell.
2
3use wyrd_spec::trace::TraceContext;
4
5/// Runtime telemetry install configuration.
6#[derive(Debug, Clone, Default, PartialEq, Eq)]
7pub struct TelemetryConfig {
8    /// Optional OTLP endpoint URL.
9    pub endpoint: Option<String>,
10}
11
12/// Span context prepared for future server wiring.
13#[derive(Debug, Clone, PartialEq, Eq)]
14pub struct SpanSeed {
15    /// Optional incoming trace context.
16    pub trace_context: Option<TraceContext>,
17    /// Span name.
18    pub name: String,
19}
20
21/// Prepare a span seed without attaching an SDK.
22#[must_use]
23pub fn prepare_span(name: impl Into<String>, trace_context: Option<TraceContext>) -> SpanSeed {
24    SpanSeed {
25        trace_context,
26        name: name.into(),
27    }
28}
29
30/// Install the runtime telemetry shell.
31///
32/// No-op today. The signature reserves the server-boundary shape so concrete
33/// SDK wiring can land without churning call sites.
34pub fn install(_config: TelemetryConfig) {}
35
36/// Attach an incoming trace context to the current runtime span.
37///
38/// No-op today; reserved for SDK integration.
39pub fn attach(_context: &TraceContext) {}