Skip to content

Commit

Permalink
updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
toralf committed Sep 8, 2024
1 parent f6d5aba commit 51ce22c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions dashboards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@ 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
regex: "([^:]+).*:(.).*"
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.

0 comments on commit 51ce22c

Please sign in to comment.