Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change prometheus to woodpecker #439

Merged
merged 1 commit into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cmd/server/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,37 +202,37 @@ func before(c *cli.Context) error { return nil }

func setupMetrics(g *errgroup.Group, store_ store.Store) {
pendingJobs := promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "drone",
Namespace: "woodpecker",
Name: "pending_jobs",
Help: "Total number of pending build processes.",
})
waitingJobs := promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "drone",
Namespace: "woodpecker",
Name: "waiting_jobs",
Help: "Total number of builds waiting on deps.",
})
runningJobs := promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "drone",
Namespace: "woodpecker",
Name: "running_jobs",
Help: "Total number of running build processes.",
})
workers := promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "drone",
Namespace: "woodpecker",
Name: "worker_count",
Help: "Total number of workers.",
})
builds := promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "drone",
Namespace: "woodpecker",
Name: "build_total_count",
Help: "Total number of builds.",
})
users := promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "drone",
Namespace: "woodpecker",
Name: "user_count",
Help: "Total number of users.",
})
repos := promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "drone",
Namespace: "woodpecker",
Name: "repo_count",
Help: "Total number of repos.",
})
Expand Down
62 changes: 31 additions & 31 deletions docs/docs/30-administration/90-prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ global:
scrape_interval: 60s

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

static_configs:
Expand All @@ -23,7 +23,7 @@ global:
scrape_interval: 60s

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

static_configs:
Expand All @@ -35,33 +35,33 @@ scrape_configs:
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
# HELP woodpecker_build_count Build count.
# TYPE woodpecker_build_count counter
woodpecker_build_count{branch="master",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 3
woodpecker_build_count{branch="mkdocs",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 3
# HELP woodpecker_build_time Build time.
# TYPE woodpecker_build_time gauge
woodpecker_build_time{branch="master",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 116
woodpecker_build_time{branch="mkdocs",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 155
# HELP woodpecker_build_total_count Total number of builds.
# TYPE woodpecker_build_total_count gauge
woodpecker_build_total_count 1025
# HELP woodpecker_pending_jobs Total number of pending build processes.
# TYPE woodpecker_pending_jobs gauge
woodpecker_pending_jobs 0
# HELP woodpecker_repo_count Total number of repos.
# TYPE woodpecker_repo_count gauge
woodpecker_repo_count 9
# HELP woodpecker_running_jobs Total number of running build processes.
# TYPE woodpecker_running_jobs gauge
woodpecker_running_jobs 0
# HELP woodpecker_user_count Total number of users.
# TYPE woodpecker_user_count gauge
woodpecker_user_count 1
# HELP woodpecker_waiting_jobs Total number of builds waiting on deps.
# TYPE woodpecker_waiting_jobs gauge
woodpecker_waiting_jobs 0
# HELP woodpecker_worker_count Total number of workers.
# TYPE woodpecker_worker_count gauge
woodpecker_worker_count 4
```
2 changes: 2 additions & 0 deletions docs/docs/91-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Some versions need some changes to the server configuration or the pipeline conf
- From version `0.15.0` ongoing there will be three types of docker images: `latest`, `next` and `x.x.x` with an alpine variant for each type like `latest-alpine`.
If you used `latest` before to try pre-release features you should switch to `next` after this release.

- Prometheus metrics have been changed from `drone_*` to `woodpecker_*`

- ...

## 0.14.0
Expand Down