2018-04-14 11:24:47 +02:00
.. include :: ../global.rst.inc
.. _monitoring:
Monitoring
==========
2019-03-18 14:48:12 +01:00
Monitoring endpoints are configured in the `` global.monitoring `` section of the config file.
2018-04-14 11:24:47 +02:00
.. _monitoring-prometheus:
2019-03-16 15:48:37 +01:00
Prometheus & Grafana
--------------------
2018-04-14 11:24:47 +02:00
zrepl can expose `Prometheus metrics <https://prometheus.io/docs/instrumenting/exposition_formats/> `_ via HTTP.
2021-03-26 07:57:43 +01:00
The `` listen `` attribute is a `net.Listen <https://golang.org/pkg/net/#Listen> `_ string for tcp, e.g. `` :9811 `` or `` 127.0.0.1:9811 `` (port 9811 was reserved to zrepl `on the official list <https://github.com/prometheus/prometheus/wiki/Default-port-allocations/_compare/43e495dd251ee328ac0d08b58084665b5c0f7a7e...459195059b55b414193ebeb80c5ba463d2606951> `_ ).
2019-12-30 19:42:17 +01:00
The `` listen_freebind `` attribute is :ref: `explained here <listen-freebind-explanation>` .
2020-02-23 23:24:12 +01:00
The Prometheus monitoring job appears in the `` zrepl control `` job list and may be specified **at most once** .
2019-03-16 15:48:37 +01:00
zrepl also ships with an importable `Grafana <https://grafana.com> `_ dashboard that consumes the Prometheus metrics:
see :repomasterlink: `dist/grafana` .
The dashboard also contains some advice on which metrics are important to monitor.
.. NOTE ::
At the time of writing, there is no stability guarantee on the exported metrics.
2018-04-14 11:24:47 +02:00
::
global:
monitoring:
- type: prometheus
2021-03-26 07:57:43 +01:00
listen: ':9811'
2019-12-30 19:42:17 +01:00
listen_freebind: true # optional, default false
2018-04-14 11:24:47 +02:00