From 51ce22ca889175c2d70cc2c42b0737708de0a9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toralf=20F=C3=B6rster?= Date: Sun, 8 Sep 2024 10:04:06 +0200 Subject: [PATCH] updated doc --- dashboards/README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dashboards/README.md b/dashboards/README.md index 8a5ab7b..80e5ec0 100644 --- a/dashboards/README.md +++ b/dashboards/README.md @@ -8,18 +8,14 @@ Few dashboards for Tor relays, Snowflake and the DDoS metrics. ## Scraping Tor metrics -An Ansible example to scrape metrics is given [here](https://github.com/toralf/tor-relays/?tab=readme-ov-file#metrics). -The Prometheus config needs to set the _nickname_, i.e. it is set using the address (usually the hostname): +An Ansible code snippet to configure a metrics port is given [here](https://github.com/toralf/tor-relays/?tab=readme-ov-file#metrics). + +The Prometheus config for the dashboard _DDoS_ needs to know the _nickname_. In the example below it is set using _address_ (== the hostname): ```yaml - job_name: "Tor-Relay" metrics_path: "/metrics-relay" - scheme: https - tls_config: - ca_file: "CA.crt" - file_sd_configs: - - files: - - "foo.yaml" + ... relabel_configs: - source_labels: [__address__] target_label: nickname @@ -27,10 +23,13 @@ The Prometheus config needs to set the _nickname_, i.e. it is set using the addr replacement: "my-nick-prefix-${1}" ``` -and _foo.yaml_ contains the targets: +where _foo.yaml_ contains the targets: ```yaml -- targets: [... +- targets: ["nick1:1234", "nick2:5678"] - targets: [... ... ``` + +My current Prometheus config is [here](./prometheus.yml). +The self-signed CA is created by the Ansible role mentioned above.