don't
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(knot): add prometheus metrics exporter

Signed-off-by: tjh <x@tjh.dev>

tjh 71f18c12 71a35ccf

+7
+1
Cargo.lock
··· 2164 2164 "http-body-util", 2165 2165 "hyper-util", 2166 2166 "maud", 2167 + "metrics-exporter-prometheus", 2167 2168 "mimetype-detector", 2168 2169 "moka", 2169 2170 "multibase",
+1
crates/gordian-knot/Cargo.toml
··· 37 37 futures-util = "0.3.32" 38 38 hyper-util = { version = "0.1.17", features = ["client"] } 39 39 maud = { version = "0.27.0", features = ["axum"] } 40 + metrics-exporter-prometheus = { version = "0.18.1" } 40 41 mimetype-detector = "0.3.4" 41 42 moka = { version = "0.12.12", features = ["future"] } 42 43 rayon = "1.11.0"
+5
crates/gordian-knot/src/cli/serve.rs
··· 21 21 use gordian_knot::model::config::{self}; 22 22 use gordian_knot::services::database::DataStore; 23 23 use gordian_types::DidBuf; 24 + use metrics_exporter_prometheus::PrometheusBuilder; 24 25 use tokio::net::TcpListener; 25 26 use tokio::signal; 26 27 use tokio::task::JoinSet; ··· 229 228 } 230 229 231 230 pub async fn serve_knot(arguments: Serve) -> anyhow::Result<()> { 231 + if let Err(error) = PrometheusBuilder::new().install() { 232 + tracing::error!(?error, "failed to install prometheus exporter"); 233 + } 234 + 232 235 let tempdir = tempfile::TempDir::with_prefix("gordian-knot-")?; 233 236 let hooks_path = if let Some(path) = &arguments.hooks { 234 237 // @TODO Verify hooks exist in the specified path.