0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-05-20 12:33:46 +02:00
synapse/contrib/prometheus
Richard van der Hoff 6a78ede569
Improve reactor_tick_time metric (#11724)
The existing implementation of the `python_twisted_reactor_tick_time` metric is pretty useless, because it *only* 
measures the time taken to execute timed calls and callbacks from threads. That neglects everything that 
happens off the back of I/O, which is obviously quite a lot for us.

To improve this, I've hooked into a different place in the reactor - in particular, where it calls `epoll`. That call is 
the only place it should wait for something to happen - the rest of the loop *should* be quick.

I've also removed `python_twisted_reactor_pending_calls`, because I don't believe anyone ever looks at it, and
it's a nuisance to populate.
2022-01-17 12:14:40 +00:00
..
consoles Improve reactor_tick_time metric (#11724) 2022-01-17 12:14:40 +00:00
README.md Fix some links in docs and contrib (#10370) 2021-07-13 11:55:48 +01:00
synapse-v1.rules make prometheus config compliant to v0.28 2018-04-05 23:34:01 +02:00
synapse-v2.rules Add missing prometheus rules for persisted events (#8802) 2020-12-02 15:18:41 +00:00

This directory contains some sample monitoring config for using the 'Prometheus' monitoring server against synapse.

To use it, first install prometheus by following the instructions at

http://prometheus.io/

for Prometheus v1

Add a new job to the main prometheus.conf file:

  job: {
    name: "synapse"

    target_group: {
      target: "http://SERVER.LOCATION.HERE:PORT/_synapse/metrics"
    }
  }

for Prometheus v2

Add a new job to the main prometheus.yml file:

  - job_name: "synapse"
    metrics_path: "/_synapse/metrics"
    # when endpoint uses https:
    scheme: "https"

    static_configs:
    - targets: ["my.server.here:port"]

An example of a Prometheus configuration with workers can be found in metrics-howto.md.

To use synapse.rules add

  rule_files:
    - "/PATH/TO/synapse-v2.rules"

Metrics are disabled by default when running synapse; they must be enabled with the 'enable-metrics' option, either in the synapse config file or as a command-line option.