juju deploy prometheus-k8s --channel edge
|latest/edge||14||14||13 Jan 2022|
Prometheus for Kubernetes clusters Read more
Discuss this charm
Share your thoughts on this charm with the community on discourse.
The Prometheus Operator provides a cluster monitoring solution using Prometheus, which is an open source monitoring system and alerting toolkit.
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
prometheus_scrape interface and preferably use the
Prometheus charm library. This charm library
add_endpoint() method that creates additional scrape
targets. Each scrape target is expected to expose a
path that exposes its metrics in a Prometheus compatible format. For
integrates 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.
The Prometheus dashboard may be accessed at a configurable 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.
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
receives alerts from Prometheus, aggregates and deduplicates them,
then forwards them to specified targets. Prometheus relates to
Alertmanager over the
- Access to Prometheus from outside the Kubernetes cluster can be
ingressrelation with the Nginx Ingress Integrator. This relation is experimental, and there is a chance the charm will evolve to use some other mechanism to be reachable from the outside of the hosting Kubernetes cluster.
- In addition, this Prometheus charm allows relations with any
charm that supports the
- This Prometheus charm does not as yet support federation. This implies scaling the number of Prometheus units results in each unit scrape the same targets.
Use Cases Supported
- Configure scrape targets through Juju relations.
- Configure alerting rules through relations with scrape target charms.
- Enable alert forwarding through a relation with Alertmanager.
- Support metrics visualisation through Grafana.
This charm by default uses the latest version of the ubuntu/prometheus image.