Version: 0.5.6

Monitoring and Metrics: Prometheus and Grafana

This page provides information about the recommended installation and configuration of Prometheus and Grafana to monitor your DCI cluster.

CogitiveScale recommends using Prometheus and Grafana for metrics collection and visualization (Dashboards). These components can easily be installed into a Kubernetes cluster using Helm.

Prerequisites

Ensure the stable Helm repository for is configured for your local installation by running:

helm repo add stable https://kubernetes-charts.storage.googleapis.com

Optional: configure the Prometheus-Operator

The Prometheus-Operator Helm chart has several configuration options and settings available, but Cortex requires only the default options that are packaged with the chart.

Feel free to customize your deployment by following the documentation for the Prometheus-Operator.

Optional: Expose Grafana via Kubernetes Ingress

To make Grafana externally available, set the grafana.ingress.enabled option to true before deploying the Grafana helm. This automatically deploys an Ingress resource that allows external access to the Grafana service, a larger list of config options for the Grafana component is available here. If you do not deploy an Ingress, you may still access Grafana using the kubectl method described below.

Install the Prometheus-Operator

Install the prometheus-operator Helm chart into a namespace. The example below uses the monitoring namespace and names this helm deployment monitoring, as well.

helm install stable/prometheus-operator --name=monitoring --namespace=monitoring --version=8.9.2

Access Grafana Dashboards via kubectl

Use this method if you have not enabled an Ingress.

The following command allows you to access a Grafana instance deployed via the prometheus-operator in the monitoring namespace,

kubectl port-forward $(kubectl get pods --selector=app=grafana -n monitoring --output=jsonpath="{.items..metadata.name}") -n monitoring 3000

Run the command then open a web browser and access Grafana over http://localhost:3000 to view metrics and dashboards for the entire cluster. Grafana comes bundled with plenty of default views/dashboards that allow you to switch between different macro and micro views of the resources/pods/namespaces/cluster.