Synapse Exporter for Prometheus
This is an exporter for Prometheus that collects metrics from a Synapse PostgreSQL database. SQLite is not supported.
It is designed to be used with the Synapse Matrix server and provides some additional metrics that are not exported by the internal Prometheus exporter.
Metrics
The exporter currently provides the following metrics:
synapse_local_users_state: Number of local users by state (active, disabled)synapse_local_users_type: Number of local users by type (guest, user, appservice)synapse_local_users_moderation: Number of local users by moderation status (active, shadow_banned, locked)synapse_local_users_appservice: Number of local users by appservice IDsynapse_total_devices: Total number of devicessynapse_total_rooms: Total number of roomssynapse_total_events: Total number of eventssynapse_federation_destinations: Number of federation destinations (i.e. federated servers)
Installation
You can install the exporter from PyPI. Within a virtual environment, run:
pip install synapse-prometheus-exporter
Configuration
The exporter is configured using a config.yaml. You can create a default configuration file in the current working directory with:
synapse-prometheus-exporter --create-config
Now, edit the config.yaml file to match your PostgreSQL connection settings. Here is an example configuration:
hosts:
- host: localhost
port: 5432
user: postgres
password: postgres
database: synapse
Usage
After you have created your config.yaml, you can start the exporter with:
synapse-prometheus-exporter
By default, the exporter listens on localhost:8999. You can change the address in the config.yaml file, or using the --host and --port flags:
synapse-prometheus-exporter --host 0.0.0.0 --port 9899
You can also specify a different configuration file with the --config flag:
synapse-prometheus-exporter --config /path/to/config.yaml
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for synapse-prometheus-exporter 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| synapse_prometheus_exporter-0.0.2.tar.gz | 5.0 kB | Without provenance | Details for synapse_prometheus_exporter-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| synapse_prometheus_exporter-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for synapse_prometheus_exporter-0.0.2-py3-none-any.whl |
Total release size: 11.8 kB
Release files / synapse_prometheus_exporter-0.0.2.tar.gz
| Download URL | synapse_prometheus_exporter-0.0.2.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d527761cd895b1fa449839d44014f29162c4038f909da2683857e873daf66124
|
|
BLAKE2b-256 checksum How to use checksums |
b1997df77789f13cfb20f65006b7fa11b2605a78f8b267111c7bf1602d5f35be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / synapse_prometheus_exporter-0.0.2-py3-none-any.whl
| Download URL | synapse_prometheus_exporter-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb6a95faad5e9bbc76ed94a7a7114b735f3c912fb973084795f889347245fde6
|
|
BLAKE2b-256 checksum How to use checksums |
1fb35c693f81a619638aea0568dda6d28ebd0dfc02ffd637226a0c6122181369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for synapse-prometheus-exporter 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.