Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions docs/metrics/grafana_dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Grafana Dashboard

The [**AINIC System Grafana Dashboard**](https://github.com/ROCm/device-metrics-exporter/tree/main/grafana) relies on the `CLUSTER_NAME` label to query and display metrics.
If this label is not present, the dashboard will render **blank**.

There are **two ways** to resolve this issue.


## Option 1: Remove the `CLUSTER_NAME` Dependency from the Dashboard

This option updates the dashboard configuration directly to remove the dependency on the `CLUSTER_NAME` label.

1. Open the **AINIC System Dashboard** in Grafana.
2. Click **Edit** → **Settings** → **Variables**.
3. Select **`g_hostname`** (third variable in the list).
4. Under **Query Options → Label Filters**, remove `$g_cluster_name`:

* Click the **✕ (cross)** icon next to `$g_cluster_name`.
5. Save the dashboard.

The dashboard will start displaying metrics without requiring the `CLUSTER_NAME` label.


## Option 2: Add the `CLUSTER_NAME` Label (Recommended for Multi-Cluster Setups)

This option preserves the dashboard as-is and explicitly provides the required `CLUSTER_NAME` label via configuration.
This is the **recommended approach** when managing multiple clusters.

### 1. Create a ConfigMap with the `CLUSTER_NAME` label

Create a file named `configmap.yaml`:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: nic-exporter-custom-config
namespace: kube-amd-network
data:
config.json: |
{
"NICConfig": {
"CustomLabels": {
"CLUSTER_NAME": "SantaClaraLab-PF"
}
}
}
```

> Replace `SantaClaraLab-PF` with your actual cluster name.

### 2. Update `networkconfig.yaml`

Ensure the following configuration is present under the exporter section:

```yaml
config:
name: nic-exporter-custom-config
```

### 3. Apply the configuration

```bash
kubectl apply -f configmap.yaml
kubectl apply -f networkconfig.yaml
```

Once the configuration is applied, the dashboard will correctly display metrics using the configured `CLUSTER_NAME`.
20 changes: 6 additions & 14 deletions docs/secondary_network/other-cnis.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,13 @@ metadata:
spec:
config: |-
{
"cniVersion": "1.0.0",
"cniVersion": "0.3.1",
"name": "sriov-nad",
"config":
{
"type": "sriov",
"spoofchk": "off",
"ipam": {
"type": "whereabouts",
"range": "51.1.1.0/24",
"exclude": [
"51.1.1.3/32",
"51.1.1.4/32"
]
}
}
"type": "sriov",
"ipam": {
"type": "whereabouts",
"range": "51.3.1.0/24"
}
}
```

Expand Down
2 changes: 1 addition & 1 deletion example/metrics-exporter/token-based-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ kube-rbac-proxy config (part of NetworkConfig):
rbacConfig:
enable: true
secret:
name: nic-metrics-tls
name: server-metrics-tls
```

ServiceMonitor Config (part of NetworkConfig):
Expand Down
Loading