feat(metrics): add Prometheus metrics and scrape endpoint
Add a prometheus metrics module with counters for requests, DDoS/scanner/ rate-limit decisions, active connections gauge, and request duration histogram. Spawn a lightweight HTTP server on a configurable port (default 9090) serving /metrics and /health endpoints. Signed-off-by: Sienna Meridian Satterwhite <sienna@sunbeam.pt>
This commit is contained in:
@@ -131,8 +131,13 @@ pub struct TlsFileConfig {
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct TelemetryConfig {
|
||||
pub otlp_endpoint: String,
|
||||
/// Port for the Prometheus metrics scrape endpoint. 0 = disabled.
|
||||
#[serde(default = "default_metrics_port")]
|
||||
pub metrics_port: u16,
|
||||
}
|
||||
|
||||
fn default_metrics_port() -> u16 { 9090 }
|
||||
|
||||
/// A path-prefix sub-route within a virtual host.
|
||||
/// Matched longest-prefix-first when multiple entries share a prefix.
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
|
||||
Reference in New Issue
Block a user