Prometheus Logo

Prometheus Integration Guide

Prometheus is a system monitoring application that implements a highly dimensional data model. TaskCall's Prometheus integration allows alerts raised by the platform to be effectively dispatched to the correct on-call responders. The integration leverages Prometheus's AlertManager plugin. The alerts can be configured as desired with minor changes to the configuration files.

Pointers
  • The integration happens between a TaskCall service and Prometheus.
  • Incidents will automatically resolve in TaskCall when metrics fall back within the normal threshold.
  • At the moment this integration only supports alerts to be received from Prometheus to TaskCall.
In TaskCall
  1. Go to Configurations > Services . Select the service you want to integrate with.
  2. Once you are on the Service details page, go to the Integrations tab. Click on New Integration.
  3. Give the integration a name.
  4. From the integration types, select the top radio button indicating that you are trying to use a built-in integration.
  5. From the list of built-in integrations, select Prometheus.
  6. Click Save.
  7. Copy the Integration Url that is issued for the integration.
On Prometheus Server
  1. Go to your Prometheus server.
  2. Install the Alertmanager plugin if you have not already. The Alertmanager allows notifications to be sent out when alerts are raised by Prometheus. If your server is hosted on Ubuntu, then you can read this article on How to Install and Configure Prometheus Alert Manager on Ubuntu.
  3. We will need to set up a webhook receiver in the configuration file. Read about Alertmanager configuration files if you are unfamiliar with them.
  4. Give the receiver a name . For example, TaskCall-Notification-Channel . Then, paste the Integration Url you copied over from TaskCall in the webhooks url field.

    receivers:
    - name: <YOUR_RECEIVER_NAME>
       webhook_configs:
       - url: <INTEGRATION_URL>


  5. The default route in Prometheus to send all alerts which do not match any custom routes to the new TaskCall receiver can be set up as shown below:

    route:    group_by: ['alertname']
       receiver: <YOUR_RECEIVER_NAME>


  6. You can also set up custom routes to send different types of alerts to different endpoints in TaskCall. For each endpoint you will need to set up a new integration to obtain a differnt Integration Url.
  7. Start the Alertmanager or restart it once you have set up the configuration file.
  8. Done! You should be all set up to receive alerts from Prometheus. You can send a test notification to yourself to test the set up with the following command:

    curl -d '[{"labels": {"alertname": "TaskCall Prometheus Test Notification", "severity": "warning"}, "annotations": {"description": "This is a test alert"}}]' http://localhost:9093/api/v1/alerts
Notes

TaskCall tries to make the alert details as contextual as possible by looking for details from the payload that is sent to it. Some of the fields that TaskCall looks for include annotations > summary, annotations > description and labels > severity. Here is a snippet of what alert rules can look like:

groups:
- name: example
   rules:
   - alert: HighRequestLatency
     expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5
   for: 10m
   labels:
       severity: page
   annotations:
       summary: High request latency
       description: The description that will be shown in the body.


Please follow the Prometheus Alerting Rules documentation to learn more.

On this page