# Grafana Integration

Export Dapr Ops Dashboard metrics to your existing observability stack. Dapr Ops Dashboard provides a pre-built Grafana dashboard that you can import into your Grafana instance to visualize Dapr Ops Dashboard metrics alongside your other observability data. The dashboards link back to Dapr Ops Dashboard for deeper analysis and provide the following views:

- **Dapr Control Plane Overview** - Monitor control plane health and performance
- **Application Performance** - Track application-level metrics and throughput
- **Component Health** - View component initialization status and usage
- **Resource Utilization** - Monitor CPU and memory usage across applications
- **Namespace filtering options** - Focus on specific Dapr system or application namespaces

[Video](https://docs.diagrid.io/img/conductor/conductor-grafana-dashboard.mp4)

### Prerequisites

Before you begin, ensure you have:

- A running [Prometheus](https://prometheus.io/docs/prometheus/latest/installation/) and [Grafana](https://grafana.com/docs/grafana/latest/setup-grafana/installation/) instance
- The [Diagrid CLI](https://docs.diagrid.io/references/conductor/conductor-cli-intro#installing-the-cli) installed

### Setup Guide

**1. Create the Dapr Ops Dashboard Prometheus data source**

1. Create an API key for Grafana to authenticate to Dapr Ops Dashboard. You can do this via the CLI or the Dapr Ops Dashboard UI:

    **Option A:** Use the Diagrid CLI
    `diagrid login diagrid apikeys create --name grafana --role diagrid:viewer`

    **Option B:** Using Dapr Ops Dashboard UI
    Navigate to  [API Keys](https://conductor.r1.diagrid.io/api-keys) in the Dapr Ops Dashboard UI and create a new API key with the `diagrid:viewer`  role.

    Important: Save the API key `token` value before navigating away. You'll need it in the next step.

2. In Grafana, add Dapr Ops Dashboard as a Prometheus data source:
   • Navigate to Connections → Data sources
   • Click Add new data source and select Prometheus
   • Configure the following:
      • Name: Enter a name (e.g., `Dapr Ops Dashboard`)
      • Prometheus server URL:  `https://api.r1.diagrid.io/apis/diagrid.io/v1beta1/prometheus`
      • HTTP Headers: Add a header with:
        • Header: `X-Diagrid-Api-Key`
        • Value: The API key token from Step 1
   • Click Save & test to verify the connection

3. Copy the data source UID from the Grafana URL. The UID appears at the end of the URL after `/edit/`. Example: If your URL is  `https://mygrafana.grafana.net/connections/datasources/edit/d53eb7d2-0ag3-4057-842e-436bfba35a03` , the UID is `d53eb7d2-0ag3-4057-842e-436bfba35a03`.

    You'll need this UID in the next section to configure the dashboard.

**2. Import the Grafana dashboard**

1. In the [Dapr Ops Dashboard UI](https://diagrid.ws/conductor), click the Help (?) icon in the upper right corner.

2. Select Grafana Dashboard from the menu and download the dashboard JSON template to your local machine.

3. In Grafana, navigate to Dashboards and click New → Import.

4. In the import dialog, use Upload dashboard JSON file to upload the template you downloaded. Click Load.

5. Configure the dashboard variables:
   • Click Edit and then the gear icon in the upper right corner to access the dashboard settings
   • Select Variables
   • Update the `datasourceUID` variable with the UID you copied in the previous section
   • Click Apply and return to the dashboard

6. Your dashboard is now configured! Use the input fields at the top to filter data:
   • `clusterID` - Select a specific cluster
   • `app-ID` - Filter by Dapr application ID

    Each dashboard panel includes a link back to the corresponding graph in Dapr Ops Dashboard for detailed analysis.

---

## What's Next?

- [Cluster Insights](https://docs.diagrid.io/dapr-open-source/dapr-ops-dashboard/observe/clusters) — Learn how to monitor cluster health and control plane status
- [Application Monitoring](https://docs.diagrid.io/dapr-open-source/dapr-ops-dashboard/observe/applications) — Explore detailed application-level metrics and performance data
- [Notifications](https://docs.diagrid.io/dapr-open-source/dapr-ops-dashboard/observe/notifications) — Set up alerts and notifications for your metrics and events
