Articles on: Articles

Using Prometheus Monitoring

Prometheus and Grafana are popular platforms used to build dashboards. The dashboards you can build using them will let you see trends over time, spikes in usage and better understand the activity on your workspace.



Prometheus works by fetching the current counts of various attributes on your workspace a few times a minute. From that data it builds up a historical database of values it can query against. Grafana is then used to build dashboards using the database Prometheus has built over time.

Note that you will need both a Prometheus server and a Grafana server in order to perform these visualizations. You can either host these services yourself or use one of the hosted services such as Hosted Metrics that do this for you.

In either case you will be configuring the "Scrape Target" in Prometheus for your Workspace. To enable your scrape target:

Visit your Workspace settings by clicking the settings icon at the bottom left.

Click on the Prometheus link to enable Prometheus monitoring



  Then click on the Prometheus line again to get your Prometheus endpoint, username and password. You can then use these to configure a new scrape target on the Prometheus server you are using.

Remember that Prometheus will need to scrape your endpoint for a period of time to build a history of the records, so it will take some time before you have useful historical metrics for graphing.

Exposed Metrics



Your Prometheus endpoint exposes aggregate counts for use in your dashboards. These include:

The total count of incoming and outgoing messages for each of your channels


rapidpro_channel_msg_count{channel_name="BotChannel",channel_uuid="16551115-2483-4c60-98c4-0bb34e7aa218",channel_type="TG",msg_direction="out",msg_type="message",org="Handy"} 993


The total count of contacts in each of your groups, plus your system groups. Example record:


rapidpro_group_contact_count{group_name="Active Users",group_uuid="f53056f9-302c-4d76-a1b4-7ed0c6132779",group_type="user",org="Handy"} 23251


You can use the attributes on the metrics to filter by or group by in your Grafana dashboards.

Updated on: 31/05/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!