How-To: Observe metrics with Grafana

The template shows Dapr system component status, dapr-operator, dapr-sidecar-injector, dapr-sentry, and dapr-placement:

The grafana-sidecar-dashboard.json template shows Dapr sidecar status, including sidecar health/resources, throughput/latency of HTTP and gRPC, Actor, mTLS, etc.:

Screenshot of the sidecar dashboard

The grafana-actor-dashboard.json template shows Dapr Sidecar status, actor invocation throughput/latency, timer/reminder triggers, and turn-based concurrnecy:

前提

  1. Add the Grafana Helm repo:

  2. Install the chart:

    1. helm install grafana grafana/grafana -n dapr-monitoring

    Note

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

  3. Retrieve the admin password for Grafana login:

    1. Validation Grafana is running in your cluster:

    Configure Prometheus as data source

    First you need to connect Prometheus as a data source to Grafana.

    1. Port-forward to svc/grafana:

      1. kubectl port-forward svc/grafana 8080:80 -n dapr-monitoring
      2. Forwarding from 127.0.0.1:8080 -> 3000
      3. Forwarding from [::1]:8080 -> 3000
      4. Handling connection for 8080
    2. Open a browser to http://localhost:8080

    3. Login to Grafana

      • Username = admin
      • Password = Password from above
    4. Select Configuration and Data Sources

      Screenshot of the Grafana add Data Source menu

    5. Add Prometheus as a data source.

    6. Get your Prometheus HTTP URL

      The Prometheus HTTP URL follows the format http://<prometheus service endpoint>.<namespace>

      1. kubectl get svc -n dapr-monitoring
      2. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
      3. dapr-prom-prometheus-alertmanager ClusterIP 10.0.255.199 <none> 80/TCP 7d9h
      4. dapr-prom-prometheus-pushgateway ClusterIP 10.0.190.59 <none> 9091/TCP 7d9h
      5. dapr-prom-prometheus-server ClusterIP 10.0.172.191 <none> 80/TCP 7d9h
      6. elasticsearch-master ClusterIP 10.0.36.146 <none> 9200/TCP,9300/TCP 7d10h
      7. elasticsearch-master-headless ClusterIP None <none> 9200/TCP,9300/TCP 7d10h
      8. grafana ClusterIP 10.0.15.229 <none> 80/TCP 5d5h
      9. kibana-kibana ClusterIP 10.0.188.224 <none> 5601/TCP 7d10h

      In this guide the server name is dapr-prom-prometheus-server and the namespace is dapr-monitoring, so the HTTP URL will be http://dapr-prom-prometheus-server.dapr-monitoring.

    7. Fill in the following settings:

      • Name: Dapr
      • HTTP URL: http://dapr-prom-prometheus-server.dapr-monitoring
      • Default: On

    8. Click button to verify that the connection succeeded.

    Import dashboards in Grafana

    1. In the upper left corner of the Grafana home screen, click the “+” option, then “Import”.

      You can now import Grafana dashboard templates from for your Dapr version:

      Screenshot of the Grafana dashboard upload option

    2. Find the dashboard that you imported and enjoy

      Tip

      Hover your mouse over the i in the corner to the description of each chart:

      Screenshot of the tooltip for graphs

    Example