chipkent / prometheus-alerts

Deephaven Prometheus Alerts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prometheus Alerts

Prometheus is an open-source systems monitoring and alerting toolkit that collects and stores its metrics as time series data. This sample app shows how to ingest data from Prometheus alerts via webhooks into Deephaven.

How it works

This app runs a Python Flask server wherever it is deployed.

Components

  • alertmanager/config.yml - The Prometheus alerts rules. This includes the configuration for the webhook alerts destination URL.
  • docker-compose.yml - Docker compose file that defines the Deephaven, Prometheus, and Python docker images.
  • flask-app/requirements.txt - Python dependencies for the application.
  • flask-app/server.py - The Python server that accepts the Prometheus alert webhooks.
  • flask-app/Dockerfile - The Dockerfile for the Python server.
  • prometheus/prometheus.yml - The Prometheus config file. This has been thinned down to handle just the alerts.
  • prometheus/rules.yml - The Prometheus alert rules file. This includes the configuration for what triggers alerts.
  • promDhAlertsStart.sh - Helper script that launches the application.

High level overview

This app runs a Python Flask server that accepts Prometheus alert webhooks. The webhooks are deserialized, and the desired values are extracted and stored into a Deephaven table.

The pydeephaven package is used for the server to interact with Deephaven.

Dependencies

Launch

Before launching, you can modify any of the files in the prometheus/ or alertmanager/ directories to configure what alerts are sent, and where the alerts are sent. The default values can be used to demonstrate functionality.

Once you are set, simply run the following to launch the app:

sh promDhAlertsStart.sh

Your Flask server should be running, and you can go to http://localhost:10000/ide to view the table in the top right Panels tab! This table will update as alerts are fired and resolved.

About

Deephaven Prometheus Alerts

License:Apache License 2.0


Languages

Language:Python 92.2%Language:Dockerfile 5.0%Language:Shell 2.8%