/prometheus-operator

Primary LanguagePythonApache License 2.0Apache-2.0

Prometheus Operator

Description

The Prometheus Operator provides a cluster monitoring solution using Prometheus, which is an open source monitoring system and alerting toolkit.

This repository contains a Juju Charm for deploying the monitoring component of Prometheus in a Kubernetes cluster. The alerting component of Prometheus is offered through a separate Charm.

Usage

The Prometheus Operator may be deployed using the Juju command line as in

$ juju deploy prometheus-k8s

By default the Prometheus Operator monitors itself, but it also accepts additional scrape targets over Juju relations with charms that support the prometheus_scrape interface and preferably use the Prometheus charm library. This charm library provides an add_endpoint() method that creates additional scrape targets. Each scrape target is expected to expose a /metrics HTTP path that exposes its metrics in a Prometheus compatible format. For example, the kube-state-metrics charm interoperates with the Prometheus K8S charm in a way that allows you import metrics about resources in a Kubernetes cluster by doing:

$ juju deploy kube-state-metrics
$ juju relate kube-state-metrics prometheus-k8s

In a similar manner any charm that exposes a scrape target may be related to the Prometheus charm.

At present it is expected that all relations the Prometheus Operator partakes in are within the same Juju model. Further development may extend this to allow cross model scrape targets.

Dashboard

The Prometheus dashboard may be accessed at a selectable port (by default 9090) on the IP address of the Prometheus unit. This unit and its IP address may be determined using the juju status command.

Relations

Currently supported relations are

  • Grafana aggregates metrics scraped by Prometheus and provides a versatile dashboard to view these metrics in configurable ways. Prometheus relates to Grafana over the grafana_datasource interface.
  • Alertmanager receives alerts from Prometheus, aggregates and deduplicates them, then forwards them to specified targets. Prometheus relates to Alertmanager over the alertmanager interface.
  • In addition this Prometheus charm allows relations with any charm that supports the prometheus_scrape relation.

OCI Images

This charm by default uses the latest version of the ubuntu/prometheus image.