prometheus_client/
metrics.rs1pub mod counter;
4pub mod exemplar;
5pub mod family;
6pub mod gauge;
7pub mod histogram;
8pub mod info;
9
10pub trait TypedMetric {
12 const TYPE: MetricType = MetricType::Unknown;
14}
15
16#[derive(Clone, Copy, Debug)]
18#[allow(missing_docs)]
19pub enum MetricType {
20 Counter,
21 Gauge,
22 Histogram,
23 Info,
24 Unknown,
25 }
31
32impl MetricType {
33 pub fn as_str(&self) -> &str {
35 match self {
36 MetricType::Counter => "counter",
37 MetricType::Gauge => "gauge",
38 MetricType::Histogram => "histogram",
39 MetricType::Info => "info",
40 MetricType::Unknown => "unknown",
41 }
42 }
43}