Grafana dashboard: Akka.NET Cluster + Phobos 2.x Message Latency Metrics (Prometheus Data Source)
Description: Message-processing latency dashboard for Akka.NET Clusters using Phobos 2.0 and OpenTelemetry.

This dashboard is built against [Phobos 2.0](https://phobos.petabridge.com/) and OpenTelemetry and is now ready for production use!

# About
This dashboard is used to visualize detailed [Akka.NET](https://getakka.net/) message-processing latency figures. It can work with or without Akka.Cluster deployment.

It's designed to consume data from the [Phobos Akka.NET APM library](https://phobos.petabridge.com/) and will automatically format the data produced natively by Phobos into the charts without any additional effort. All this dashboard requires is a Prometheus instance that is accessible via Grafana and Phobos.

**Dashboard Issues & Improvements**: you can submit requests and tickets to improve this Akka.NET + Phobos dashboard here: [https://github.com/petabridge/phobos-dashboards](https://github.com/petabridge/phobos-dashboards)

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "bargauge",
      "name": "Bar gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.2.6"
    },
    {
      "type": "panel",
      "id": "heatmap",
      "name": "Heatmap",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard",
        "datasource": "${DS_PROMETHEUS}"
      }
    ]
  },
  "description": "Message-processing latency dashboard for Akka.NET Clusters using Phobos 2.0 and OpenTelemetry.",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 15638,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1656518812833,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 7,
      "panels": [],
      "title": "[$msgtype] Cumulative Latencies",
      "type": "row"
    },
    {
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateSpectral",
        "exponent": 0.5,
        "mode": "opacity"
      },
      "dataFormat": "tsbuckets",
      "datasource": "${DS_PROMETHEUS}",
      "description": "Heatmap of milliseconds of latency by $msgtype",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 1
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 8,
      "legend": {
        "show": false
      },
      "maxDataPoints": 25,
      "pluginVersion": "7.3.7",
      "reverseYBuckets": false,
      "targets": [
        {
          "expr": "sum(increase(akka_messages_latency_ms_bucket{messagetype=~\"$msgtype\"}[$__interval])) by (le)",
          "format": "heatmap",
          "instant": false,
          "interval": "",
          "legendFormat": "{{le}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Latency Over Time [$msgtype ]",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "datasource": "${DS_PROMETHEUS}",
      "description": "Heatmap of milliseconds of latency by $msgtype",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 1
      },
      "id": 9,
      "maxDataPoints": 25,
      "options": {
        "displayMode": "gradient",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true,
        "text": {}
      },
      "pluginVersion": "8.2.6",
      "targets": [
        {
          "expr": "sum(akka_messages_latency_ms_bucket{messagetype=~\"$msgtype\"}) by (le)",
          "format": "heatmap",
          "instant": false,
          "interval": "",
          "legendFormat": "{{le}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Latency Distribution [$msgtype ]",
      "type": "bargauge"
    },
    {
      "collapsed": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "id": 5,
      "panels": [],
      "title": "[$msgtype] Latencies When Processed by [$actortype]",
      "type": "row"
    },
    {
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateSpectral",
        "exponent": 0.5,
        "mode": "opacity"
      },
      "dataFormat": "tsbuckets",
      "datasource": "${DS_PROMETHEUS}",
      "description": "Heatmap of milliseconds of latency by $actortype / $msgtype",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 10
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 2,
      "legend": {
        "show": false
      },
      "maxDataPoints": 25,
      "pluginVersion": "7.3.7",
      "reverseYBuckets": false,
      "targets": [
        {
          "expr": "sum(increase(akka_messages_latency_ms_bucket{messagetype=~\"$msgtype\",actortype=~\"$actortype\"}[$__interval])) by (le)",
          "format": "heatmap",
          "instant": false,
          "interval": "",
          "legendFormat": "{{le}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Latency Over Time [$actortype / $msgtype ]",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "datasource": "${DS_PROMETHEUS}",
      "description": "Heatmap of milliseconds of latency by $actortype / $msgtype",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 10
      },
      "id": 3,
      "maxDataPoints": 25,
      "options": {
        "displayMode": "gradient",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true,
        "text": {}
      },
      "pluginVersion": "8.2.6",
      "targets": [
        {
          "expr": "sum(akka_messages_latency_ms_bucket{messagetype=~\"$msgtype\",actortype=~\"$actortype\"}) by (le)",
          "format": "heatmap",
          "instant": false,
          "interval": "",
          "legendFormat": "{{le}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Latency Distribution [$actortype / $msgtype ]",
      "type": "bargauge"
    }
  ],
  "refresh": "10s",
  "schemaVersion": 32,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(messagetype)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "msgtype",
        "multi": false,
        "name": "msgtype",
        "options": [],
        "query": {
          "query": "label_values(messagetype)",
          "refId": "prometheus-msgtype-Variable-Query"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(actortype)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "actortype",
        "multi": false,
        "name": "actortype",
        "options": [],
        "query": {
          "query": "label_values(actortype)",
          "refId": "prometheus-actortype-Variable-Query"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-5m",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Akka.NET Cluster + Phobos 2.x Message Latency Metrics (Prometheus Data Source)",
  "uid": "-MOG0hx7z",
  "version": 1
}