MassTransit - Messages Monitoring
MassTransit is a message-based distributed application framework for .NET http://masstransit-project.com.

MassTransit supports Prometheus metric capture, which provides useful observability into the bus, endpoints, consumers, and messages.

This dashboard shows the messages published and sent using MassTransit framework.
# MassTransit Messages Monitoring

**[MassTransit](https://masstransit-project.com/)** is a message-based distributed application framework for .NET http://masstransit-project.com.

MassTransit supports **[Prometheus](https://masstransit-project.com/advanced/monitoring/prometheus.html)** metric capture, which provides useful observability into the bus, endpoints, consumers, and messages.

This dashboard shows the messages published and sent using MassTransit framework.

Messages can be:
 - Events (one to many using Publish interface)
 - Commands (one to one using Send interface)

It's using the following labels to filter out metric values:
 - env (ASPNETCORE_ENVIRONMENT)
 - domain
 - app
 - MessageType
 - ConsumerType

Env, domain and app labels must be added following [prometheus-net docs](https://github.com/prometheus-net/prometheus-net#static-labels).
{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS_(METRICS)",
      "label": "Prometheus (Metrics)",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.3.1"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "$$hashKey": "object:636",
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 58,
      "title": "General",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Events are objects published and broadcasted to be picked up by all consumers that are listening to that event type. It means that something has happened. (e.g.: UserUpdated)",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 0,
        "y": 1
      },
      "id": 55,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 0,
        "showHeader": true
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "increase(mt_publish_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range])",
          "format": "table",
          "instant": true,
          "legendFormat": "{{app}}",
          "range": false,
          "refId": "A"
        }
      ],
      "title": "Messages Published (Events)",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "app",
                "domain",
                "message_type",
                "Value"
              ]
            }
          }
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Value": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "app": {
                "aggregations": [],
                "operation": "groupby"
              },
              "domain": {
                "aggregations": [],
                "operation": "groupby"
              },
              "message_type": {
                "aggregations": [],
                "operation": "groupby"
              },
              "service_name": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Commands are objects sent direct to an endpoint and will be picked up by the first consumer that implements it. It means that something must be performed after receiving that message.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 12,
        "y": 1
      },
      "id": 66,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 0,
        "showHeader": true
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "increase(mt_send_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range])",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "B"
        }
      ],
      "title": "Messages Sent (Commands)",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "app",
                "domain",
                "message_type",
                "Value"
              ]
            }
          }
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Value": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "app": {
                "aggregations": [],
                "operation": "groupby"
              },
              "domain": {
                "aggregations": [],
                "operation": "groupby"
              },
              "message_type": {
                "aggregations": [],
                "operation": "groupby"
              },
              "service_name": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Number of bus instances",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 6,
        "x": 0,
        "y": 11
      },
      "id": 52,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(mt_bus{env=\"$environment\",app=~\"$application\"})",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Bus instances",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Total number of messages consumed",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 18,
        "x": 6,
        "y": 11
      },
      "id": 56,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "increase(mt_consume_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\",consumer_type=~\"$ConsumerType\"}[$__range])",
          "format": "table",
          "instant": true,
          "legendFormat": "{{app}}",
          "range": false,
          "refId": "A"
        }
      ],
      "title": "Messages Consumed",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "app",
                "consumer_type",
                "domain",
                "message_type",
                "Value"
              ]
            }
          }
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Value": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "app": {
                "aggregations": [],
                "operation": "groupby"
              },
              "consumer_type": {
                "aggregations": [],
                "operation": "groupby"
              },
              "domain": {
                "aggregations": [],
                "operation": "groupby"
              },
              "instance": {
                "aggregations": [],
                "operation": "groupby"
              },
              "message_type": {
                "aggregations": [],
                "operation": "groupby"
              },
              "service_name": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 21
      },
      "id": 37,
      "panels": [],
      "title": "Producers",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Total number of messages consumed (one to many events)",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 0,
        "y": 22
      },
      "id": 43,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(increase(mt_publish_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Publish Total",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 6,
        "y": 22
      },
      "id": 64,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(rate(mt_publish_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Publish Rate",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Total number of message publish faults",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 12,
        "y": 22
      },
      "id": 48,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(increase(mt_publish_fault_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Publish Fault Total",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 18,
        "y": 22
      },
      "id": 63,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(rate(mt_publish_fault_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Publish Fault Rate",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Total number of messages sent (one to one commands)",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 0,
        "y": 30
      },
      "id": 44,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(increase(mt_send_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Send Total",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              }
            ]
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 6,
        "y": 30
      },
      "id": 61,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(rate(mt_send_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Send Rate",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Total number of message send faults",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red"
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 12,
        "y": 30
      },
      "id": 50,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(increase(mt_send_fault_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Send Fault Total",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red"
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 18,
        "y": 30
      },
      "id": 62,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(rate(mt_send_fault_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Send Fault Rate",
      "type": "stat"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "loki",
        "uid": "loki"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 38
      },
      "id": 18,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "loki",
            "uid": "loki"
          },
          "refId": "A"
        }
      ],
      "title": "Consumers",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Total number of messages consumed",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 0,
        "y": 39
      },
      "id": 31,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(increase(mt_consume_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consume Total",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              }
            ]
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 6,
        "y": 39
      },
      "id": 65,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(rate(mt_consume_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consume Rate",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Total number of message consume faults",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red"
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 12,
        "y": 39
      },
      "id": 38,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(increase(mt_consume_fault_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consume Fault Total",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red"
              }
            ]
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 18,
        "y": 39
      },
      "id": 60,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(rate(mt_consume_fault_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consume Fault Rate",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Number of receive endpoint instances.",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue"
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 0,
        "y": 47
      },
      "id": 47,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(mt_endpoint{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"})",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consume endpoints total",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Number of consumers in progress",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue"
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 6,
        "y": 47
      },
      "id": 39,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(increase(mt_consumer_in_progress{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consumers in progress",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Total number of message consume retries",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "yellow"
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 12,
        "y": 47
      },
      "id": 42,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(increase(mt_consume_retry_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__range]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consume Retry Total",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "mappings": [
            {
              "$$hashKey": "object:7339",
              "id": 0,
              "op": "=",
              "text": "N/A",
              "type": 1,
              "value": "null"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "yellow"
              }
            ]
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 18,
        "y": 47
      },
      "id": 59,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "sum(rate(mt_consume_retry_total{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval]))",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consume Retry Rate",
      "type": "stat"
    },
    {
      "alert": {
        "alertRuleTags": {},
        "conditions": [
          {
            "evaluator": {
              "params": [
                5
              ],
              "type": "gt"
            },
            "operator": {
              "type": "and"
            },
            "query": {
              "params": [
                "A",
                "5m",
                "now"
              ]
            },
            "reducer": {
              "params": [],
              "type": "avg"
            },
            "type": "query"
          }
        ],
        "executionErrorState": "alerting",
        "for": "5m",
        "frequency": "1m",
        "handler": 1,
        "name": "Consume Duration alert",
        "noDataState": "no_data",
        "notifications": []
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Elapsed time spent consuming a message, in seconds.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "line+area"
            }
          },
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "transparent"
              },
              {
                "color": "red",
                "value": 5
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 55
      },
      "id": 6,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "histogram_quantile(0.95, sum(rate(mt_consume_duration_seconds_bucket{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval])) by (message_type,le))  ",
          "legendFormat": "{{message_type}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Consume Duration (Seconds)",
      "type": "timeseries"
    },
    {
      "alert": {
        "alertRuleTags": {},
        "conditions": [
          {
            "evaluator": {
              "params": [
                42
              ],
              "type": "gt"
            },
            "operator": {
              "type": "and"
            },
            "query": {
              "params": [
                "A",
                "10s",
                "now"
              ]
            },
            "reducer": {
              "params": [],
              "type": "avg"
            },
            "type": "query"
          }
        ],
        "executionErrorState": "alerting",
        "for": "10s",
        "frequency": "5s",
        "handler": 1,
        "name": "Delivery Duration Long",
        "noDataState": "no_data",
        "notifications": []
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS_(METRICS)}"
      },
      "description": "Elapsed time between when the message was sent and when it was consumed, in seconds.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "line+area"
            }
          },
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "transparent"
              },
              {
                "color": "red",
                "value": 62
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 55
      },
      "id": 8,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "9.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS_(METRICS)}"
          },
          "editorMode": "code",
          "expr": "histogram_quantile(0.95, sum(rate(mt_delivery_duration_seconds_bucket{env=\"$environment\",app=~\"$application\",message_type=~\"$MessageType\"}[$__rate_interval])) by (message_type,le))",
          "legendFormat": "{{message_type}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Delivery Duration (Seconds)",
      "type": "timeseries"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 37,
  "style": "dark",
  "tags": [
    "MassTransit",
    "Event Driven Architecture"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "Prometheus (Metrics)",
          "value": "Prometheus (Metrics)"
        },
        "hide": 2,
        "includeAll": false,
        "multi": false,
        "name": "datasource",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(env)",
        "hide": 0,
        "includeAll": false,
        "label": "Environment",
        "multi": false,
        "name": "environment",
        "options": [],
        "query": {
          "query": "label_values(env)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(domain)",
        "hide": 0,
        "includeAll": true,
        "label": "Domain",
        "multi": true,
        "name": "domain",
        "options": [],
        "query": {
          "query": "label_values(domain)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(app)",
        "hide": 0,
        "includeAll": true,
        "label": "Application",
        "multi": true,
        "name": "application",
        "options": [],
        "query": {
          "query": "label_values(app)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(message_type)",
        "hide": 0,
        "includeAll": true,
        "label": "Message Type",
        "multi": true,
        "name": "MessageType",
        "options": [],
        "query": {
          "query": "label_values(message_type)",
          "refId": "Prometheus (Metrics)-MessageType-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(consumer_type)",
        "hide": 0,
        "includeAll": true,
        "label": "Consumer Type",
        "multi": true,
        "name": "ConsumerType",
        "options": [],
        "query": {
          "query": "label_values(consumer_type)",
          "refId": "Prometheus (Metrics)-ConsumerType-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(mt_publish_total,message_type)",
        "hide": 2,
        "includeAll": true,
        "label": "Publish Message Type",
        "multi": false,
        "name": "PublishMessageType",
        "options": [],
        "query": {
          "query": "label_values(mt_publish_total,message_type)",
          "refId": "Prometheus (Metrics)-PublishMessageTypes-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(mt_send_total,message_type)",
        "hide": 2,
        "includeAll": true,
        "label": "Send Message Type",
        "multi": true,
        "name": "SendMessageType",
        "options": [],
        "query": {
          "query": "label_values(mt_send_total,message_type)",
          "refId": "Prometheus (Metrics)-SendMessageTypes-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(mt_saga_in_progress,consumer_type)",
        "hide": 2,
        "includeAll": true,
        "multi": false,
        "name": "SagaType",
        "options": [],
        "query": {
          "query": "label_values(mt_saga_in_progress,consumer_type)",
          "refId": "Prometheus (Metrics)-SagaType-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS_(METRICS)}"
        },
        "definition": "label_values(mt_saga_in_progress,message_type)",
        "hide": 2,
        "includeAll": true,
        "multi": false,
        "name": "SagaMessageType",
        "options": [],
        "query": {
          "query": "label_values(mt_saga_in_progress,message_type)",
          "refId": "Prometheus (Metrics)-SagaMessageType-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-5m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "MassTransit - Messages Monitoring",
  "uid": "vOtk-UjWz-2",
  "version": 6,
  "weekStart": "",
  "gnetId": 17680,
  "description": "MassTransit is a message-based distributed application framework for .NET http://masstransit-project.com.\r\n\r\nMassTransit supports Prometheus metric capture, which provides useful observability into the bus, endpoints, consumers, and messages.\r\n\r\nThis dashboard shows the messages published and sent using MassTransit framework."
}