-
Notifications
You must be signed in to change notification settings - Fork 7
Metrics
Samuel Garcés Marín edited this page Jan 15, 2022
·
1 revision
If you are building a component, you sure want to put some metrics in it. Internally you can use whatever framework for metrics you like, but the kernel, that reads your Capabilities, will use the metrics defined in your MetricDefinitions.
pub struct SiemMetricDefinition {
pub metric: SiemMetric,
pub name: Cow<'static, str>,
pub description: Cow<'static, str>,
pub tags: BTreeMap<Cow<'static, str>, Cow<'static, str>>,
}
pub enum SiemMetric {
Counter(Arc<AtomicI64>),
/// Atomic reference and a multiplier
Gauge(Arc<AtomicI64>, f32),
/// Timer in milliseconds
Timer(Arc<AtomicU64>),
Histogram(HistogramMetric),
Summary(SummaryMetric),
}