Skip to main content

Crate sz_orm_tracing

Crate sz_orm_tracing 

Source
Expand description

§SZ-ORM Tracing — 链路追踪

提供分布式链路追踪的 Span/Tracer 抽象,支持 OTLP exporter 上报, 用于跨服务调用链的采集与可视化。

§主要类型

  • Span — 单个追踪片段
  • Tracer — 追踪器与导出器

§采样与上下文传播(sampling 模块)

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 等)。
ErrorBudget
错误预算(Error Budget),基于 SLO 目标和滑动时间窗口。
ErrorRateCounter
错误率计数器,基于滑动时间窗口统计错误率。
InMemoryAlertHook
内存告警钩子(非真实 Webhook):将告警存入内存,不进行任何网络发送。
LatencyHistogram
延迟分位数直方图。
LogAlertHook
将告警输出到标准错误流的简单实现。
OtelTracer
A compatibility wrapper that exposes the same Tracer interface as the OpenTelemetry SDK but is implemented internally by delegating every call to a SzTracer.
SaturationGauge
饱和度告警仪表盘。
SlaMonitor
SLA 监控器,按操作名聚合延迟与错误统计,并生成 SlaReport
SlaReport
SLA 监控报告快照,由 SlaMonitor::report 生成。
Span
SpanLog
SzTracer

Enums§

AlertLevel
告警级别。
TracingError

Traits§

AlertHook
告警分发钩子。实现方可以将告警写入日志、发送到 Webhook、推送到 IM 等。
Tracer