llm_optimizer_processor/metrics/
mod.rs1mod labels;
8mod prometheus;
9mod registry;
10mod server;
11
12pub use labels::{LabelSet, LabelValue, MetricLabels};
13pub use prometheus::{ProcessorMetrics, MetricsSnapshot};
14pub use registry::{MetricsRegistry, METRICS_REGISTRY};
15pub use server::{MetricsServer, MetricsServerConfig, HealthStatus};
16
17use thiserror::Error;
18
19#[derive(Error, Debug)]
21pub enum MetricsError {
22 #[error("Failed to start metrics server: {0}")]
23 ServerStartError(String),
24
25 #[error("Failed to bind to address {address}: {source}")]
26 BindError {
27 address: String,
28 source: std::io::Error,
29 },
30
31 #[error("Invalid metric label: {0}")]
32 InvalidLabel(String),
33
34 #[error("Metric registration failed: {0}")]
35 RegistrationError(String),
36
37 #[error("Metric encoding error: {0}")]
38 EncodingError(String),
39}
40
41pub type Result<T> = std::result::Result<T, MetricsError>;