Skip to main content

wist_metrics/
lib.rs

1//! Metrics collection contract shared by system collectors (in `wist-agentd`) and
2//! non-system collectors (database / external services, kept here to isolate heavy drivers).
3//!
4//! This crate owns the W4「契约层 + 采集层抽象」:
5//! - [`provider`]:`MetricProvider` trait 与采集结果类型(collect → samples 的中转结构);
6//! - [`target`]:采集目标视图条目(provider 的输入);
7//! - [`spec`]:指标声明表(fact_key → 规范化指标名/单位/类型);
8//! - [`names`]:**非 fact 派生**的规范名(agent 自观测 `agent_*`)、序列 label 键与单位换算 ——
9//!   写入端(agentd)与读取端(网关 / 中心)共同引用,名字只改一处。
10//!
11//! 系统指标(host/process/container)的 provider 仍在 `wist-agentd` 里实现;非系统指标
12//! (Postgres / MySQL / …)的 provider 放本 crate,其重依赖(如 `sqlx`)以 feature 门控,
13//! 不进入 `wist-agentd` 的默认依赖图。
14
15pub mod names;
16pub mod provider;
17pub mod spec;
18pub mod target;