How-To: Collect metrics with Prometheus

Use Prometheus to collect time-series data from the Radius control plane

Prometheus collects and stores metrics as time series data. This guide will show you how to collect Radius control plane metrics to then be visualized and queried.

Install Prometheus on Kubernetes

  1. Make sure you have the following pre-requisites:

  2. Create a namespace that can be used to deploy the Grafana and Prometheus monitoring tools:

    kubectl create namespace radius-monitoring
    
  3. Install Prometheus into your monitoring namespace:

    helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
    helm repo update
    helm install radius-prom prometheus-community/prometheus -n radius-monitoring
    

    If you are Minikube user or want to disable persistent volume for development purposes, you can disable it by using the following command.

    helm install radius-prom prometheus-community/prometheus -n radius-monitoring --set alertmanager.persistentVolume.enable=false --set pushgateway.persistentVolume.enabled=false --set server.persistentVolume.enabled=false
    
  4. Validate your Prometheus installation:

    kubectl get pods -n radius-monitoring
    

    You should see something similar to the following:

    NAME                                                  READY   STATUS    RESTARTS   AGE
    radius-prom-kube-state-metrics-9849d6cc6-t94p8        1/1     Running   0          4m58s
    radius-prom-prometheus-alertmanager-749cc46f6-9b5t8   2/2     Running   0          4m58s
    radius-prom-prometheus-node-exporter-5jh8p            1/1     Running   0          4m58s
    radius-prom-prometheus-node-exporter-88gbg            1/1     Running   0          4m58s
    radius-prom-prometheus-node-exporter-bjp9f            1/1     Running   0          4m58s
    radius-prom-prometheus-pushgateway-688665d597-h4xx2   1/1     Running   0          4m58s
    radius-prom-prometheus-server-694fd8d7c-q5d59         2/2     Running   0          4m58s
    
  5. Done! Prometheus is now installed and ready to collect metrics from the Radius control plane.

Next step: Add a Grafana dashboard

Now that you have Prometheus installed, you can visualize the metrics using Grafana. Follow the Grafana installation guide to get up and running with a Grafana dashboard.

Next: Add a Grafana dashboard

Further reading