Prometheus and Grafana

🎬 Watch Before You Begin

c8-labs Landing Page
🧭 Video Timeline

In this video, you’ll install Prometheus, set up Grafana, add Prometheus as a data source, and import the Camunda dashboard.

  • [00:05]
    Quick recap.
  • [00:20]
    Run the script to install Prometheus.
  • [00:45]
    Reconnect with Headlamp Dashboard.
  • [01:26]
    Validate Prometheus Pod is running.
  • [01:42]
    Run the script to install Grafana.
  • [02:25]
    Use the Grafana app URL endpoint and Sign-In to the webapp.
  • [03:04]
    Validate if Prometheus is added as a data source.
  • [03:15]
    Create a new dashboard using the Camunda official raw config file.
  • [04:45]
    See live camunda statistics and health data. Each panel here tells a story!
  • [06:41]
    Video ends

Let's install monitoring tools: Prometheus and Grafana.

Prometheus


export UNAMESPACE={{UNAMESPACE}}

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
UNAMESPACE={{UNAMESPACE}} envsubst < prometheus.yml > prometheus.my-ns.yaml
kubectl apply -f prometheus.my-ns.yaml -n ${UNAMESPACE}

Install prometheus in the same namespace.

Grafana


helm repo add grafana https://grafana.github.io/helm-charts

helm repo update
UNAMESPACE={{UNAMESPACE}} envsubst < grafana.yaml > grafana.my-ns.yaml
kubectl apply -f grafana.my-ns.yaml -n ${UNAMESPACE}
UNAMESPACE={{UNAMESPACE}} envsubst < c8-ingress-grafana.yaml | kubectl apply -f -

Install Grafana and link Prometheus as datasource.
Also note that we are adding ingress for accessing Grafana app. You can sign-in to Grafana:
https://{{UNAMESPACE}}.makelabs.in/grafana
Default admin account: admin

Configure Grafana

  • Verify if Prometheus endpoint is added as Data Source
  • Dashboard for Camunda components
            
####### Grafana UI - Setup data source and import dashboard
#######
####### Open Grafana in a new browser tab
#######
# Step 1.  Go to (left side nav panel in Grafana) Connections -> Datasources. Check if prometheus exists as data source. (this is part of grafana.yaml)
# Step 2.a Go to Dashboard -> Import. (Right side corner -> click on New drop-down -> select Import)
#      2.b Visit this page on your browser ->> https://github.com/camunda/camunda/blob/stable/8.9/monitor/grafana/zeebe.json    
#      2.c Click on "copy raw file". We'll use the JSON as seed data to create the new dashboard.
#      2.d Back to Grafana -> Paste into the text-area "Import via dashboard JSON model". Click on Load.
#      2.e It may take few seconds for Grafana to load the dashboard.


# To check prometheus data feed - run this from toolkit pod where curl is supported
curl -s http://prometheus.{{UNAMESPACE}}:9090/api/v1/targets 
                

This completes the Grafana configuration. You can now view the dashboard.

⚠️ Try this: Can you see the Cluster Topology data on this dashboard?

Click on image to enlarge
Grafana view


Next: Post Deployment Summary