Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: add initial support for prometheus metrics. #1465

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Commits on Apr 1, 2023

  1. 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
    ```
    ykuksenko committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    15c155b View commit details
    Browse the repository at this point in the history