Commit 6c43ec81 authored by Ahmad Sherif's avatar Ahmad Sherif
Browse files

Explain web config format

Closes #20
parent 6e38391b
Pipeline #44669 passed with stage
in 4 minutes and 35 seconds
......@@ -2,7 +2,8 @@
gitlab-monitor is a [Prometheus Web exporter] that does the following:
1. Collects GitLab production metrics via custom probes defined in a YAML file.
1. Collects GitLab production metrics via custom probes defined in a YAML file
(config format is explained in [config/gitlab-monitor.yml.example]).
2. Custom probes gather measurements in the form of key/value pairs.
3. For each probe, gitlab-monitor creates an HTTP endpoint `/<probe_name>`
(by default on port 9168) that delivers these metrics to a Prometheus scraper.
......@@ -43,3 +44,4 @@ which has to connect to the database, set the connection_string to:
[Prometheus Web exporter]: https://prometheus.io/docs/instrumenting/exporters/
[GitLab Development Kit]: https://gitlab.com/gitlab-org/gitlab-development-kit
[config/gitlab-monitor.yml.example]: https://gitlab.com/gitlab-org/gitlab-monitor/blob/master/config/gitlab-monitor.yml.example
db_common: &db_common
methods:
- probe_db
opts:
connection_string: dbname=gitlabhq_development user=postgres
# Web server config
server:
listen_address: 0.0.0.0
listen_port: 9168
# Probes config
probes:
database:
multiple: true
tuple_stats:
class_name: Database::TuplesProber
methods:
- probe_db
opts:
connection_string: dbname=gitlabhq_development user=postgres
# Each key corresponds to an endpoint, so here metrics are available at http://localhost:9168/git.
# The server will search for a prober using the format `KeyProber`, so here it will be `GitProber`.
# If there's no prober matching the format above, `class_name` key should be provided (see `git_process` below).
git:
# Methods to call on the prober
methods:
- probe_pull
- probe_push
# Options to pass to the prober class initializer
opts:
source: /home/git/repo
git_process:
class_name: GitProcessProber # `class_name` is redundant here
methods:
- probe_git
opts:
quantiles: true
# We can group multiple probes under a single endpoint by setting the `multiple` key to `true`, followed
# by probe definitions as usual.
database:
multiple: true
blocked_queries:
class_name: Database::BlockedQueriesProber
<<: *db_common
ci_builds:
class_name: Database::CiBuildsProber
<<: *db_common
tuple_stats:
class_name: Database::TuplesProber
<<: *db_common
rows_count:
class_name: Database::RowCountProber
<<: *db_common
slow_queries:
class_name: Database::SlowQueriesProber
<<: *db_common
vacuum_queries:
class_name: Database::VacuumQueriesProber
<<: *db_common
process:
methods:
- probe_memory
......@@ -30,6 +66,7 @@ probes:
- pid_or_pattern: "git-upload-pack --stateless-rpc"
name: git_upload_pack
quantiles: true
sidekiq:
methods:
- probe_queues
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment