Prometheus

Parny | Prometheus Integration Guide

Parny supports direct integration with Prometheus alerts. Prometheus is a network and system monitoring tool that can create alarms to detect and prevent potential problems. This documentation explains how to redirect alarms created in Prometheus to a webhook using Parny.


Parny Settings


  1. Go to the Parny interface.

  2. Navigate to the "Services" section of your organization.

  3. Click on the "New Services" option in the upper right corner.

  4. Enter the relevant service name.

Service Name Usage: The service name here is independent of the structure and can be chosen according to the preferences of the organization.


  1. Select Prometheus from the list of integrations.

  2. Click "Add".

  3. After the service is created, the following screen will appear.


drawing


  • You can now click on the token section of your service and copy your Prometheus Webhook URL.


Prometheus Configuration

In this section, we will guide you through "Adding Alert Notification" and "Redirecting Alarms".


Step 1: Alertmanager Settings


  1. For Alertmanager settings, it is added as a route under Receiver and Routes Receivers section in Prometheus Alertmanager's YAML file.


drawing


global:
receivers:
- name: "parnyio"
  webhook_configs:
	   - url: 'https://prometheus.parny.io/alert/XXXXXXXXXXXXXXX'
	     send_resolved: true
route:
  group_by:
  - instance
  group_interval: 5m
  group_wait: 10s
  receiver: default-receiver
  repeat_interval: 3h
  routes:
	  - match:
  		    continue: true
	    receiver: parnyio

Note: The send_resolved parameter is required to receive resolved alerts.



  1. The "url" parameter you have passed in this section is the alert endpoint of the service you have created through the Parny portal.


  1. Although the "send_resolved" parameter is boolean, it sends an alert with a "resolved" status value again for your alerts that have returned to the normal value range after going into the alert state. Parny Prometheus API is customized to detect alerts with this value and switch them to "Resolved" automatically. You can view an example of an alert automatically "resolved" by the Prometheus API in the screenshot below.


drawing


Step 2: Redirecting Alarms


Here, it will be discussed how our alerts should be created so that it can be interpreted more properly by Parny.


For each alert that you will forward to the Prometheus API, 3 alarm labels called “instance”, “severity” and “service” and alert “description” information under “annotations” must be defined as alert rule.


drawing


- alert: NodeCPUUsage
  labels:
    instance: {{ $labels.instance }}
    severity: warning
    service: Kubernetes
  annotations:
    description: '{{ $labels.instance }}: CPU usage is above 90% (current value is: {{ $value }})'
    summary: '{{ $labels.instance }}: CPU usage is above 90% (current value is: {{ $value }})'
  expr: 100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle", kubernetes_node=~".+"}[5m])) * 100) > 90
  for: 3m


With these settings, your Prometheus alarms will be forwarded to Parny, allowing you to manage them alongside your other alerts within your organization's Parny interface.