Software / code / prosody-modules
Comparison
mod_prometheus/README.md @ 6003:fe081789f7b5
All community modules: Unify file extention of Markdown files to .md
| author | Menel <menel@snikket.de> |
|---|---|
| date | Tue, 22 Oct 2024 10:26:01 +0200 |
| parent | 5413:mod_prometheus/README.markdown@c90011054335 |
| child | 6047:8c3bacf3549e |
comparison
equal
deleted
inserted
replaced
| 6002:5a65a632d5b9 | 6003:fe081789f7b5 |
|---|---|
| 1 --- | |
| 2 labels: | |
| 3 - Statistics | |
| 4 summary: Implementation of the Prometheus protocol | |
| 5 ... | |
| 6 | |
| 7 Description | |
| 8 =========== | |
| 9 | |
| 10 This module implements the Prometheus reporting protocol, allowing you | |
| 11 to collect statistics directly from Prosody into Prometheus. | |
| 12 | |
| 13 See the [Prometheus documentation][prometheusconf] on the format for | |
| 14 more information. | |
| 15 | |
| 16 [prometheusconf]: https://prometheus.io/docs/instrumenting/exposition_formats/ | |
| 17 | |
| 18 ::: {.alert .alert-info} | |
| 19 **Note:** For use with Prosody trunk (0.12) we recommend the bundled | |
| 20 [mod_http_openmetrics](https://prosody.im/doc/modules/mod_http_openmetrics) | |
| 21 instead. This module (mod_prometheus) will continue to be available in the | |
| 22 community repository for use with older Prosody versions. | |
| 23 ::: | |
| 24 | |
| 25 Configuration | |
| 26 ============= | |
| 27 | |
| 28 mod\_prometheus itself doesn’t have any configuration option, but it | |
| 29 requires Prosody’s [internal statistics | |
| 30 provider](https://prosody.im/doc/statistics#built-in_providers) to be | |
| 31 enabled. You may also want to change the default collection interval | |
| 32 to the one your statistics consumer is using. See below for more information. | |
| 33 | |
| 34 ```lua | |
| 35 statistics = "internal" | |
| 36 statistics_interval = 15 -- in seconds | |
| 37 ``` | |
| 38 | |
| 39 ::: {.alert .alert-warning} | |
| 40 **NOTE:** Make sure to put the statistics variables in the global section of | |
| 41 the configuration, **not** in a `VirtualHost` or `Component` section. You can | |
| 42 use `prosodyctl check` if you are unsure and want to check your configuration. | |
| 43 ::: | |
| 44 | |
| 45 See also the documentation of Prosody’s [HTTP | |
| 46 server](https://prosody.im/doc/http), since Prometheus is an HTTP | |
| 47 protocol that is how you can customise its URL. The default one being | |
| 48 http://localhost:5280/metrics | |
| 49 | |
| 50 Scrape interval vs statistics_interval | |
| 51 -------------------------------------- | |
| 52 | |
| 53 The `statistics_interval` should be set to `"manual"` on trunk if and only | |
| 54 if you have a single Prometheus instance scraping Prosody. This will allow | |
| 55 the internal statistics gathering to run optimally. | |
| 56 | |
| 57 If you have multiple instances scraping Prosody, set `statistics_interval` | |
| 58 to the scrape interval of Prometheus to avoid errors in rate calculations | |
| 59 and similar. | |
| 60 | |
| 61 Future work will allow the use of `"manual"` with multiple Prometheus | |
| 62 instances and varying scrape intervals (stay tuned). | |
| 63 | |
| 64 Compatibility | |
| 65 ============= | |
| 66 | |
| 67 ------- ------------- | |
| 68 trunk Works (but replaced by [mod_http_openmetrics](https://prosody.im/doc/modules/mod_http_openmetrics)) | |
| 69 0.11 Works | |
| 70 0.10 Works | |
| 71 0.9 Does not work | |
| 72 ------- ------------- |