diff --git a/Cargo.toml b/Cargo.toml index e038f17..0cc1ec7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,11 +5,12 @@ authors = ["dkos "] edition = "2018" categories = ["http", "rocksdb", "storage", "actix-web"] description = "RocksDb as a service with support for multiple databases and record expiration" +exclude = [".gitignore", "docs/**"] [dependencies] structopt = "0.3" actix-web = "3" -actix-web-prom = "0.3.0" +actix-web-prom = "0.5.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" simplelog = "0.7.6" diff --git a/README.md b/README.md index 671d1c6..416a16d 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ You can delete data with a ```DELETE``` request on ```SERVICE_URL:SERVICE_PORT/{ A successful request is indicated by a ```200 OK``` HTTP status code. ### Metrics -Service metrics in [prometheus format](https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md) are available for scraping under ```SERVICE_URL:SERVICE_PORT/metrics``` +Service metrics in [prometheus format](https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md) are available for scraping under ```SERVICE_URL:SERVICE_PORT/rocky/prometheus/metrics``` ## Configuration @@ -116,12 +116,6 @@ Payload: 1kb ![Delete latency](docs/delete_latency.png?raw=true "Delete latency") ![Delete tps](docs/delete_tps.png?raw=true "Delete tps") - - - - - - ### TODO - [ ] fix running test in parallel (TODO per test db root path) - [ ] db iterator for on startup init diff --git a/src/main.rs b/src/main.rs index 0a43ee9..99f5363 100644 --- a/src/main.rs +++ b/src/main.rs @@ -189,11 +189,11 @@ async fn main() -> std::io::Result<()> { let db_manager = DbManager::new(db_cfg)?; let db_manager = web::Data::new(db_manager); - let _prometheus = init_prometheus(); + let prometheus = init_prometheus(); HttpServer::new(move || { App::new() .wrap(ErrorHandlers::new().handler(http::StatusCode::NOT_FOUND, not_found)) - // .wrap(prometheus.clone()) // TODO waiting 3.0 upgrade + .wrap(prometheus.clone()) .app_data(db_manager.clone()) .service(open) .service(close) @@ -211,7 +211,7 @@ async fn main() -> std::io::Result<()> { } fn init_prometheus() -> PrometheusMetrics { - PrometheusMetrics::new("api", Some("/metrics"), None) + PrometheusMetrics::new("api", Some("/rocky/prometheus/metrics"), None) } fn init_logger(log_path: &str, dev_mode: bool) {