Skip to content

Commit

Permalink
Fix Grafana dashboards.
Browse files Browse the repository at this point in the history
The current grafana dashboards do not work in a fresh cluster where
prometheus and grafana are installed using helm following Dapr Docs
(see [1], [2]). They refer to metrics that are not available in
such install.

In short, based on bug-report from dapr/test-infra#204, the proposed
fix can be summed by:

```bash
sed -i \
    -e 's/\bkubernetes_name\b/service/g' \
    -e 's/\bkubernetes_namespace\b/namespace/g' \
    -e 's/\bkubernetes_node\b/node/g' \
    -e 's/\bkubernetes_pod_name\b/pod/g' \
    *.json
```

Additionally:

* Removes refresh rates smaller than 1 minute.
* Sets default interval range to 14 days in the past to now
* Sets default template values to match the longhaul clusters.

Fixes dapr#7120

[1]: https://docs.dapr.io/operations/observability/metrics/prometheus/#setup-prometheus-on-kubernetes
[2]: https://docs.dapr.io/operations/observability/metrics/grafana/#setup-on-kubernetes

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
  • Loading branch information
tmacam committed Oct 31, 2023
1 parent 441017b commit 21b5034
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 75 deletions.
41 changes: 20 additions & 21 deletions grafana/grafana-actor-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@
"steppedLine": false,
"targets": [
{
"expr": "histogram_quantile(0.95, sum(rate(dapr_http_server_latency_bucket{path=~\"/v1.0/actors/$dapr_actor_type/.*\", kubernetes_namespace=\"$namespace\"}[5m])) by (le, app_id, method, path))",
"expr": "histogram_quantile(0.95, sum(rate(dapr_http_server_latency_bucket{path=~\"/v1.0/actors/$dapr_actor_type/.*\", namespace=\"$namespace\"}[5m])) by (le, app_id, method, path))",
"format": "time_series",
"instant": false,
"interval": "",
"legendFormat": "[95p] {{method}} {{path}} ({{app_id}})",
"refId": "A"
},
{
"expr": "histogram_quantile(0.75, sum(rate(dapr_http_server_latency_bucket{path=~\"/v1.0/actors/$dapr_actor_type/.*\", kubernetes_namespace=\"$namespace\"}[5m])) by (le, app_id, method, path))",
"expr": "histogram_quantile(0.75, sum(rate(dapr_http_server_latency_bucket{path=~\"/v1.0/actors/$dapr_actor_type/.*\", namespace=\"$namespace\"}[5m])) by (le, app_id, method, path))",
"format": "time_series",
"instant": false,
"interval": "",
Expand Down Expand Up @@ -200,7 +200,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (app_id, method, path) (rate(dapr_http_server_response_count{path=~\"/v1.0/actors/$dapr_actor_type/.*\", kubernetes_namespace=\"$namespace\"}[5m]))",
"expr": "sum by (app_id, method, path) (rate(dapr_http_server_response_count{path=~\"/v1.0/actors/$dapr_actor_type/.*\", namespace=\"$namespace\"}[5m]))",
"format": "time_series",
"instant": false,
"interval": "",
Expand Down Expand Up @@ -302,15 +302,15 @@
"steppedLine": false,
"targets": [
{
"expr": "histogram_quantile(0.95, sum(rate(dapr_http_client_roundtrip_latency_bucket{path=~\"actors/$dapr_actor_type/.*/method/.*\", kubernetes_namespace=\"$namespace\"}[5m])) by (le, app_id, method, path))",
"expr": "histogram_quantile(0.95, sum(rate(dapr_http_client_roundtrip_latency_bucket{path=~\"actors/$dapr_actor_type/.*/method/.*\", namespace=\"$namespace\"}[5m])) by (le, app_id, method, path))",
"format": "time_series",
"instant": false,
"interval": "",
"legendFormat": "[95p] {{method}} /{{path}} ({{app_id}})",
"refId": "A"
},
{
"expr": "histogram_quantile(0.75, sum(rate(dapr_http_client_roundtrip_latency_bucket{path=~\"actors/$dapr_actor_type/.*/method/.*\", kubernetes_namespace=\"$namespace\"}[5m])) by (le, app_id, method, path))",
"expr": "histogram_quantile(0.75, sum(rate(dapr_http_client_roundtrip_latency_bucket{path=~\"actors/$dapr_actor_type/.*/method/.*\", namespace=\"$namespace\"}[5m])) by (le, app_id, method, path))",
"format": "time_series",
"instant": false,
"interval": "",
Expand Down Expand Up @@ -414,7 +414,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (app_id, method, path) (rate(dapr_http_client_completed_count{path=~\"actors/$dapr_actor_type/.*/method/.*\", kubernetes_namespace=\"$namespace\"}[5m]))",
"expr": "sum by (app_id, method, path) (rate(dapr_http_client_completed_count{path=~\"actors/$dapr_actor_type/.*/method/.*\", namespace=\"$namespace\"}[5m]))",
"format": "time_series",
"instant": false,
"interval": "",
Expand Down Expand Up @@ -530,7 +530,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(dapr_http_client_roundtrip_latency_bucket{path=~\"actors/$dapr_actor_type/.*/method/timer/.*\", kubernetes_namespace=\"$namespace\"}[5m])) by (path)",
"expr": "sum(rate(dapr_http_client_roundtrip_latency_bucket{path=~\"actors/$dapr_actor_type/.*/method/timer/.*\", namespace=\"$namespace\"}[5m])) by (path)",
"format": "time_series",
"instant": false,
"interval": "",
Expand Down Expand Up @@ -632,7 +632,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(dapr_http_client_roundtrip_latency_bucket{path=~\"actors/$dapr_actor_type/.*/method/remind/.*\", kubernetes_namespace=\"$namespace\"}[5m])) by (path)",
"expr": "sum(rate(dapr_http_client_roundtrip_latency_bucket{path=~\"actors/$dapr_actor_type/.*/method/remind/.*\", namespace=\"$namespace\"}[5m])) by (path)",
"format": "time_series",
"instant": false,
"interval": "",
Expand Down Expand Up @@ -802,22 +802,21 @@
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": false,
"text": "pipeline",
"value": "pipeline"
"text": "longhaul-test",
"value": "longhaul-test"
},
"datasource": "Dapr",
"definition": "label_values(dapr_runtime_component_loaded,kubernetes_namespace)",
"definition": "label_values(dapr_runtime_component_loaded,namespace)",
"error": null,
"hide": 0,
"includeAll": false,
"label": "NAMESPACE",
"multi": false,
"name": "namespace",
"options": [],
"query": "label_values(dapr_runtime_component_loaded,kubernetes_namespace)",
"query": "label_values(dapr_runtime_component_loaded,namespace)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand All @@ -829,11 +828,14 @@
"useTags": false
},
{
"allValue": null,
"current": {
"selected": false,
"text": "StateActor",
"value": "StateActor"
"selected": true,
"text": [
"HashTagActor"
],
"value": [
"HashTagActor"
]
},
"datasource": "Dapr",
"definition": "label_values(dapr_runtime_actor_pending_actor_calls,actor_type)",
Expand All @@ -858,14 +860,11 @@
]
},
"time": {
"from": "now-3h",
"from": "now-14d",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
Expand Down

0 comments on commit 21b5034

Please sign in to comment.