Expand description
§SZ-ORM Tracing — 链路追踪
提供分布式链路追踪的 Span/Tracer 抽象,支持 OTLP exporter 上报, 用于跨服务调用链的采集与可视化。
§主要类型
Span— 单个追踪片段Tracer— 追踪器与导出器
§采样与上下文传播(sampling 模块)
sampling::Sampler/sampling::TraceIdRatioSampler— 采样策略sampling::Baggage/sampling::BaggagePropagator— W3C Baggage 传播sampling::BatchSpanExporter— 批量 Span 导出
Re-exports§
pub use sampling::AlwaysOffSampler;pub use sampling::AlwaysOnSampler;pub use sampling::Baggage;pub use sampling::BaggagePropagator;pub use sampling::BatchConfig;pub use sampling::BatchSpanExporter;pub use sampling::ParentBasedSampler;pub use sampling::Sampler;pub use sampling::SamplingDecision;pub use sampling::TraceIdRatioSampler;
Modules§
- sampling
- 采样策略与 Baggage 传播
Structs§
- Alert
- 告警事件,由
SaturationGauge/SlaMonitor等组件在检测到异常时产生, 通过AlertHook分发到下游(日志、Webhook 等)。 - Error
Budget - 错误预算(Error Budget),基于 SLO 目标和滑动时间窗口。
- Error
Rate Counter - 错误率计数器,基于滑动时间窗口统计错误率。
- InMemory
Alert Hook - 内存告警钩子(非真实 Webhook):将告警存入内存,不进行任何网络发送。
- Latency
Histogram - 延迟分位数直方图。
- LogAlert
Hook - 将告警输出到标准错误流的简单实现。
- Otel
Tracer - A compatibility wrapper that exposes the same
Tracerinterface as the OpenTelemetry SDK but is implemented internally by delegating every call to aSzTracer. - Saturation
Gauge - 饱和度告警仪表盘。
- SlaMonitor
- SLA 监控器,按操作名聚合延迟与错误统计,并生成
SlaReport。 - SlaReport
- SLA 监控报告快照,由
SlaMonitor::report生成。 - Span
- SpanLog
- SzTracer