view mod_prometheus/README.markdown @ 4293:edde5905744a

mod_s2s_keepalive: Don't send whitespace keepalives before s2sin stream is open Could possibly result in whitespace before the XML and stream header, which isn't allowed by the parser. Don't think s2sout is affected, as the stream is opened early and doesn't have to wait for the other end. Thanks Ge0rG
author Kim Alvefur <zash@zash.se>
date Thu, 10 Dec 2020 11:57:03 +0100
parents 313e293f44b3
children f4ab80f72d63
line wrap: on
line source

---
labels:
- Statistics
summary: Implementation of the Prometheus protocol
...

Description
===========

This module implements the Prometheus reporting protocol, allowing you
to collect statistics directly from Prosody into Prometheus.

See the [Prometheus documentation][prometheusconf] on the format for
more information.

[prometheusconf]: https://prometheus.io/docs/instrumenting/exposition_formats/

Configuration
=============

mod\_prometheus itself doesn’t have any configuration option, but it
requires Prosody’s [internal statistics
provider](https://prosody.im/doc/statistics#built-in_providers) to be
enabled.  You may also want to change the default collection interval
to the one your statistics consumer is using.

```lua
statistics = "internal"
statistics_interval = 15 -- in seconds
```

::: {.alert .alert-warning}
**NOTE:** Make sure to put the statistics variables in the global section of
the configuration, **not** in a `VirtualHost` or `Component` section.  You can
use `prosodyctl check` if you are unsure and want to check your configuration.
:::

See also the documentation of Prosody’s [HTTP
server](https://prosody.im/doc/http), since Prometheus is an HTTP
protocol that is how you can customise its URL.  The default one being
http://localhost:5280/metrics

Compatibility
=============

  ------- -------------
  trunk   Works
  0.11    Works
  0.10    Works
  0.9     Does not work
  ------- -------------