-
-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add initial prometheus metrics support
--- Metrics for the prometheus endpoint are slightly different from the json one. - I do not want to break things for those that use the old endpoint. - Some metrics are hard to utilize in Prometheus without a format change. (example: certificate timestamp) - Usually blackbox_exporter would cover certificate monitoring, but since people use TRMM with multiple proxies both internal monitoring and blackbox_exporter may be useful. - Memory and disk space was not transfered because they are system wide and Prometheus users likely will have node_exporter installed for that. - Prometheus format has slightly more detailed metrics. --- Instructions: 1. Setup MON_TOKEN variable in `/rmm/api/tacticalrmm/tacticalrmm/local_settings.py` for your bearer_token. This is the same as for the json endpoint. See [Tips and Tricks](https://docs.tacticalrmm.com/tipsntricks/#monitor-your-trmm-instance-via-the-built-in-monitoring-endpoint). 2. Test with curl command: `curl -s -H "Authorization: Bearer $MON_TOKEN" https://api.trmm.example.com/core/status/` 3. Setup Prometheus job with: ``` - job_name: trmm scrape_interval: 60s metrics_path: /core/status/ scheme: https bearer_token: $MON_TOKEN static_configs: - targets: - api.trmm.example.com ```
- Loading branch information
Showing
3 changed files
with
299 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters