woodpecker/docs/docs/30-administration/90-prometheus.md
Anbraten 9267a46d5c
[Docs] Migrate docs framework to Docusaurus (#282)
- Replace mkdocs with docosaurus (improved menu structure, ...)
- Structure docs into `Usage` and `Server Setup / Administration`
- Update favicon
- Create new pipeline-syntax page with all options and links to more detailed docs if available
- Add ci to publish to `woodpecker-ci.github.io`
- Deploy docs preview to surge for review
- Update start-page

Co-authored-by: 6543 <6543@obermui.de>
2021-09-11 17:10:32 +02:00

2.2 KiB

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.

global:
  scrape_interval: 60s

scrape_configs:
  - job_name: 'drone'
    bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

    static_configs:
       - targets: ['woodpecker.domain.com']

Authorization

An administrator will need to generate a user api token and configure in the prometheus configuration file as a bearer token. Please see the following example:

global:
  scrape_interval: 60s

scrape_configs:
  - job_name: 'drone'
+   bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

    static_configs:
       - targets: ['woodpecker.domain.com']

Metric Reference

List of prometheus metrics specific to Woodpecker:

# HELP drone_build_count Build count.
# TYPE drone_build_count counter
drone_build_count{branch="master",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 3
drone_build_count{branch="mkdocs",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 3
# HELP drone_build_time Build time.
# TYPE drone_build_time gauge
drone_build_time{branch="master",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 116
drone_build_time{branch="mkdocs",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 155
# HELP drone_build_total_count Total number of builds.
# TYPE drone_build_total_count gauge
drone_build_total_count 1025
# HELP drone_pending_jobs Total number of pending build processes.
# TYPE drone_pending_jobs gauge
drone_pending_jobs 0
# HELP drone_repo_count Total number of repos.
# TYPE drone_repo_count gauge
drone_repo_count 9
# HELP drone_running_jobs Total number of running build processes.
# TYPE drone_running_jobs gauge
drone_running_jobs 0
# HELP drone_user_count Total number of users.
# TYPE drone_user_count gauge
drone_user_count 1
# HELP drone_waiting_jobs Total number of builds waiting on deps.
# TYPE drone_waiting_jobs gauge
drone_waiting_jobs 0
# HELP drone_worker_count Total number of workers.
# TYPE drone_worker_count gauge
drone_worker_count 4