Skip to content

Commit

Permalink
doc: improve prometheus docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik-Haag committed Oct 22, 2023
1 parent bb7e0f9 commit a28ee7d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/docs/30-administration/90-prometheus.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prometheus

Woodpecker is compatible with Prometheus and exposes a `/metrics` endpoint. Please note that access to the metrics endpoint is restricted and requires an authorization token with administrative privileges.
Woodpecker is compatible with Prometheus and exposes a `/metrics` endpoint if you set the `WOODPECKER_PROMETHEUS_AUTH_TOKEN` environment variable. Please note that access to the metrics endpoint is restricted and requires an authorization token with administrative privileges.

```yaml
global:
Expand Down Expand Up @@ -30,6 +30,20 @@ scrape_configs:
- targets: ['woodpecker.domain.com']
```
You can also read the token from a file like so:
```diff
global:
scrape_interval: 60s

scrape_configs:
- job_name: 'woodpecker'
+ bearer_token_file: /etc/secrets/woodpecker-monitoring-token

static_configs:
- targets: ['woodpecker.domain.com']
```
## Unauthenticated Access
Alternatively, the unprotected `/metrics` endpoint might be exposed on the internal port. (Port is configurable via the `WOODPECKER_METRICS_SERVER_ADDR` environment variable, e.g. `:9001`.)
Expand Down

0 comments on commit a28ee7d

Please sign in to comment.