daemon: expose prometheus in new global.monitoring config section + document it

refs #67
This commit is contained in:
Christian Schwarz
2018-04-14 11:24:47 +02:00
parent a4da029105
commit 82ea535692
10 changed files with 71 additions and 10 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ Logging
zrepl uses structured logging to provide users with easily processable log messages.
Logging outlets are configured in the ``global`` section of the |mainconfig|.
Check out :sampleconf:`random/logging.yml` for an example on how to configure multiple outlets:
Check out :sampleconf:`random/logging_and_monitoring.yml` for an example on how to configure multiple outlets:
::
+30
View File
@@ -0,0 +1,30 @@
.. include:: ../global.rst.inc
.. _monitoring:
Monitoring
==========
Monitoring endpoints are configured in the ``global.monitoring`` section of the |mainconfig|.
Check out :sampleconf:`random/logging_and_monitoring.yml` for examples.
.. _monitoring-prometheus:
Prometheus
----------
zrepl can expose `Prometheus metrics <https://prometheus.io/docs/instrumenting/exposition_formats/>`_ via HTTP.
The ``listen`` attribute is a `net.Listen <https://golang.org/pkg/net/#Listen>`_ string for tcp, e.g. ``:9091`` or ``127.0.0.1:9091``.
The Prometheues monitoring job appears in the ``zrepl control`` job list and may be specified **at most once**.
There is no stability guarantee on the exported metrics.
::
global:
monitoring:
- type: prometheus
listen: ':9091'