From 07eac06a36b5f4c81325e64dcdafc499ee9c9109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 26 Feb 2023 12:10:12 +0100 Subject: [PATCH] Enable prometheus by default, update README --- README.md | 21 ++++++++++++--------- aquatic_http/Cargo.toml | 1 + aquatic_udp/Cargo.toml | 1 + aquatic_ws/Cargo.toml | 1 + 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e99def3..507d0a7 100644 --- a/README.md +++ b/README.md @@ -125,17 +125,11 @@ in emitting of an info-level log message. #### Prometheus -`aquatic_http` and `aquatic_ws` support exporting [Prometheus](https://prometheus.io/) metrics. +Exporting [Prometheus](https://prometheus.io/) metrics is supported. -Pass the `prometheus` feature when building: +To use, activate the prometheus endpoint in the configuration file: -```sh -. ./scripts/env-native-cpu-without-avx-512 -cargo build --release -p aquatic_ws --features "prometheus" -cargo build --release -p aquatic_http --features "prometheus" -``` - -Then activate the prometheus endpoint in the configuration file: +##### aquatic_http and aquatic_ws ```toml [metrics] @@ -143,6 +137,15 @@ run_prometheus_endpoint = true prometheus_endpoint_address = "0.0.0.0:9000" ``` +##### aquatic_udp + +```toml +[statistics] +interval = 5 +run_prometheus_endpoint = true +prometheus_endpoint_address = "0.0.0.0:9000" +``` + ### Running If you're running `aquatic_http` or `aquatic_ws`, please make sure locked memory diff --git a/aquatic_http/Cargo.toml b/aquatic_http/Cargo.toml index de3640c..89be7df 100644 --- a/aquatic_http/Cargo.toml +++ b/aquatic_http/Cargo.toml @@ -17,6 +17,7 @@ name = "aquatic_http" name = "aquatic_http" [features] +default = ["prometheus"] prometheus = ["metrics", "metrics-exporter-prometheus"] metrics = ["dep:metrics"] diff --git a/aquatic_udp/Cargo.toml b/aquatic_udp/Cargo.toml index 7012031..505595a 100644 --- a/aquatic_udp/Cargo.toml +++ b/aquatic_udp/Cargo.toml @@ -17,6 +17,7 @@ name = "aquatic_udp" name = "aquatic_udp" [features] +default = ["prometheus"] cpu-pinning = ["aquatic_common/hwloc"] prometheus = ["metrics", "metrics-exporter-prometheus"] diff --git a/aquatic_ws/Cargo.toml b/aquatic_ws/Cargo.toml index a3da870..6e35944 100644 --- a/aquatic_ws/Cargo.toml +++ b/aquatic_ws/Cargo.toml @@ -17,6 +17,7 @@ name = "aquatic_ws" name = "aquatic_ws" [features] +default = ["prometheus"] prometheus = ["metrics", "metrics-exporter-prometheus"] metrics = ["dep:metrics"]