Grafana dashboard: Mongo
Description: MongoDB dashboard based on graphite data-source and telegraf collector. Focused on replica set.


Credit to https://grafana.com/orgs/saada who dashboard was the starting guide to this but using a different datasource: https://grafana.com/dashboards/2583


{
  "__inputs": [
    {
      "name": "DS_PAAS_METRICS",
      "label": "PaaS Metrics",
      "description": "Graphite data source with whisper DB",
      "type": "datasource",
      "pluginId": "graphite",
      "pluginName": "Graphite"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "4.6.4"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "graphite",
      "name": "Graphite",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "MongoDB dashboard based on graphite data-source and telegraf collector. Focused on replica set.\n\n\nCredit to https://grafana.com/orgs/saada who dashboard was the starting guide to this but using a different datasource: https://grafana.com/dashboards/2583",
  "editable": true,
  "gnetId": 11281,
  "graphTooltip": 1,
  "hideControls": false,
  "id": null,
  "links": [],
  "refresh": false,
  "rows": [
    {
      "collapse": false,
      "height": 217,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 7,
          "legend": {
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.queries_per_sec, 10), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Query Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 20,
          "legend": {
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.commands_per_sec, 10), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": true
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Commands Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 21,
          "legend": {
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.deletes_per_sec, 10), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Deletes Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 22,
          "legend": {
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.getmores_per_sec, 10), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "GetMore Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 23,
          "legend": {
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.inserts_per_sec, 10), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": true
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Inserts Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 24,
          "legend": {
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.updates_per_sec, 10), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Updates Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        }
      ],
      "repeat": "dataEnv",
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": true,
      "title": "Query Metrics for $region",
      "titleSize": "h4"
    },
    {
      "collapse": false,
      "height": 216,
      "panels": [
        {
          "cacheTimeout": null,
          "colorBackground": true,
          "colorValue": false,
          "colors": [
            "#bf1b00",
            "#508642",
            "#bf1b00"
          ],
          "datasource": "${DS_PAAS_METRICS}",
          "description": "Replica State",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 29,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "refId": "A",
              "target": "keepLastValue(infrastructure.*.$region*.$region-mongo0*.mongodb.*.replica_set_member_state, 5)",
              "textEditor": true
            }
          ],
          "thresholds": "1,3",
          "title": "$region-mongo0",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            },
            {
              "op": "=",
              "text": "STARTUP",
              "value": "0"
            },
            {
              "op": "=",
              "text": "PRIMARY",
              "value": "1"
            },
            {
              "op": "=",
              "text": "SECONDARY",
              "value": "2"
            },
            {
              "op": "=",
              "text": "RECOVERING",
              "value": "3"
            },
            {
              "op": "=",
              "text": "STARTUP2",
              "value": "5"
            },
            {
              "op": "=",
              "text": "UNKNOWN",
              "value": "6"
            },
            {
              "op": "=",
              "text": "ARBITER",
              "value": "7"
            },
            {
              "op": "=",
              "text": "DOWN",
              "value": "8"
            },
            {
              "op": "=",
              "text": "ROLLBACK",
              "value": "9"
            },
            {
              "op": "=",
              "text": "REMOVED",
              "value": "10"
            }
          ],
          "valueName": "current"
        },
        {
          "cacheTimeout": null,
          "colorBackground": true,
          "colorValue": false,
          "colors": [
            "#bf1b00",
            "#508642",
            "#bf1b00"
          ],
          "datasource": "${DS_PAAS_METRICS}",
          "description": "Replica State",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 30,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "refId": "A",
              "target": "keepLastValue(infrastructure.*.$region*.$region-mongo1*.mongodb.*.replica_set_member_state, 5)",
              "textEditor": true
            }
          ],
          "thresholds": "1,3",
          "title": "$region-mongo1",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            },
            {
              "op": "=",
              "text": "STARTUP",
              "value": "0"
            },
            {
              "op": "=",
              "text": "PRIMARY",
              "value": "1"
            },
            {
              "op": "=",
              "text": "SECONDARY",
              "value": "2"
            },
            {
              "op": "=",
              "text": "RECOVERING",
              "value": "3"
            },
            {
              "op": "=",
              "text": "STARTUP2",
              "value": "5"
            },
            {
              "op": "=",
              "text": "UNKNOWN",
              "value": "6"
            },
            {
              "op": "=",
              "text": "ARBITER",
              "value": "7"
            },
            {
              "op": "=",
              "text": "DOWN",
              "value": "8"
            },
            {
              "op": "=",
              "text": "ROLLBACK",
              "value": "9"
            },
            {
              "op": "=",
              "text": "REMOVED",
              "value": "10"
            }
          ],
          "valueName": "current"
        },
        {
          "cacheTimeout": null,
          "colorBackground": true,
          "colorValue": false,
          "colors": [
            "#bf1b00",
            "#508642",
            "#bf1b00"
          ],
          "datasource": "${DS_PAAS_METRICS}",
          "description": "Replica State",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 31,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "refId": "A",
              "target": "keepLastValue(infrastructure.*.$region*.$region-mongo2*.mongodb.*.replica_set_member_state, 5)",
              "textEditor": true
            }
          ],
          "thresholds": "1,3",
          "title": "$region-mongo2",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            },
            {
              "op": "=",
              "text": "STARTUP",
              "value": "0"
            },
            {
              "op": "=",
              "text": "PRIMARY",
              "value": "1"
            },
            {
              "op": "=",
              "text": "SECONDARY",
              "value": "2"
            },
            {
              "op": "=",
              "text": "RECOVERING",
              "value": "3"
            },
            {
              "op": "=",
              "text": "STARTUP2",
              "value": "5"
            },
            {
              "op": "=",
              "text": "UNKNOWN",
              "value": "6"
            },
            {
              "op": "=",
              "text": "ARBITER",
              "value": "7"
            },
            {
              "op": "=",
              "text": "DOWN",
              "value": "8"
            },
            {
              "op": "=",
              "text": "ROLLBACK",
              "value": "9"
            },
            {
              "op": "=",
              "text": "REMOVED",
              "value": "10"
            }
          ],
          "valueName": "current"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 11,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_repl_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "E",
              "step": 600,
              "target": "aliasSub(keepLastValue(infrastructure.*.$region*.$region-mongo*.mongodb.*.repl_queries_per_sec, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Replica Query Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 40,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_repl_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "E",
              "step": 600,
              "target": "aliasSub(keepLastValue(infrastructure.*.$region*.$region-mongo*.mongodb.*.repl_inserts_per_sec, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Replica Inserts Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 32,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_repl_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 600,
              "target": "aliasSub(keepLastValue(infrastructure.*.$region*.$region-mongo*.mongodb.*.repl_commands_per_sec, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Replica Commands Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 37,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_repl_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 600,
              "target": "aliasSub(keepLastValue(infrastructure.*.$region*.$region-mongo*.mongodb.*.repl_deletes_per_sec, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Replica Deletes Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 38,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_repl_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 600,
              "target": "aliasSub(keepLastValue(infrastructure.*.$region*.$region-mongo*.mongodb.*.repl_getmores_per_sec, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Replica GetMores Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 39,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_op_counters_repl_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "E",
              "step": 600,
              "target": "aliasSub(keepLastValue(infrastructure.*.$region*.$region-mongo*.mongodb.*.repl_updates_per_sec, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Replica Updates Per Second",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "description": "The time difference between the oldest and newest entries in the oplog. That’s the amount of time an operation will remain in the oplog before being overwritten by a new entry.\n\nFirstly, your replication oplog window tells you how long a secondary member can be offline and still catch up to the primary without doing a full resync\n\nThe second, and more subtle, issue is that replication oplog window is also the maximum amount of time it can take to perform the initial phase of a full sync (either when adding a new secondary, or fully resyncing a stale one)",
          "fill": 1,
          "id": 6,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [
            {
              "targetBlank": true,
              "title": "replication oplog window",
              "type": "absolute",
              "url": "https://www.mongodb.com/blog/post/replica-set-health-is-more-than-just-replication"
            }
          ],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "mongodb_replset_oplog_size_bytes{instance=~\"$env\"}",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "metric": "mongodb_locks_time_acquiring_global_microseconds_total",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.repl_oplog_window_sec, 10), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": true
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Replication Oplog Window",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "dtdurations",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "alert": {
            "conditions": [
              {
                "evaluator": {
                  "params": [
                    1,
                    2
                  ],
                  "type": "outside_range"
                },
                "operator": {
                  "type": "and"
                },
                "query": {
                  "params": [
                    "A",
                    "5m",
                    "now"
                  ]
                },
                "reducer": {
                  "params": [],
                  "type": "last"
                },
                "type": "query"
              },
              {
                "evaluator": {
                  "params": [
                    1,
                    2
                  ],
                  "type": "outside_range"
                },
                "operator": {
                  "type": "or"
                },
                "query": {
                  "params": [
                    "B",
                    "5m",
                    "now"
                  ]
                },
                "reducer": {
                  "params": [],
                  "type": "last"
                },
                "type": "query"
              },
              {
                "evaluator": {
                  "params": [
                    1,
                    2
                  ],
                  "type": "outside_range"
                },
                "operator": {
                  "type": "or"
                },
                "query": {
                  "params": [
                    "C",
                    "5m",
                    "now"
                  ]
                },
                "reducer": {
                  "params": [],
                  "type": "last"
                },
                "type": "query"
              }
            ],
            "executionErrorState": "alerting",
            "frequency": "60s",
            "handler": 1,
            "message": "A member of the MongoDB replica set is no longer acting as a \"primary\" or \"secondary\"",
            "name": "Alert for replica status alert",
            "noDataState": "keep_state",
            "notifications": []
          },
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "description": "If state move out of range 1:2 then will alert\nEach value maps to a state see:",
          "fill": 1,
          "id": 43,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": false,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [
            {
              "targetBlank": true,
              "title": "replica set member state",
              "type": "absolute",
              "url": "https://docs.mongodb.com/v3.2/reference/replica-states/"
            }
          ],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "mongodb_replset_oplog_size_bytes{instance=~\"$env\"}",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "metric": "mongodb_locks_time_acquiring_global_microseconds_total",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.*.prd_data.prd-mongo0*.mongodb.*.replica_set_member_state, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            },
            {
              "expr": "mongodb_replset_oplog_size_bytes{instance=~\"$env\"}",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "metric": "mongodb_locks_time_acquiring_global_microseconds_total",
              "refId": "B",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.*.prd_data.prd-mongo1*.mongodb.*.replica_set_member_state, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            },
            {
              "expr": "mongodb_replset_oplog_size_bytes{instance=~\"$env\"}",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "metric": "mongodb_locks_time_acquiring_global_microseconds_total",
              "refId": "C",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.*.prd_data.prd-mongo2*.mongodb.*.replica_set_member_state, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [
            {
              "colorMode": "critical",
              "fill": true,
              "line": true,
              "op": "lt",
              "value": 1
            },
            {
              "colorMode": "critical",
              "fill": true,
              "line": true,
              "op": "gt",
              "value": 2
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Replica set member state",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "none",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": "env",
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": true,
      "title": "Replica Set Metrics for $region",
      "titleSize": "h4"
    },
    {
      "collapse": false,
      "height": 210,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 4,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "hideEmpty": false,
            "hideZero": false,
            "max": true,
            "min": true,
            "rightSide": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "mongodb_memory{instance=~\"$env\",type=~\"resident|virtual\"}",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mem.used_percent, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Memory Used",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": [
              "total"
            ]
          },
          "yaxes": [
            {
              "format": "percent",
              "label": "MB",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 5,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_network_bytes_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{state}}",
              "metric": "mongodb_metrics_operation_total",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.net_in_bytes, 10), '.*_data\\.([^_]*?)_.*(net.*?)\\)', '\\1-\\2')",
              "textEditor": false
            },
            {
              "expr": "rate(mongodb_network_bytes_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{state}}",
              "metric": "mongodb_metrics_operation_total",
              "refId": "B",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.net_out_bytes, 10), '.*_data\\.([^_]*?)_.*(net.*?)\\)', '\\1-\\2')",
              "textEditor": false
            },
            {
              "expr": "rate(mongodb_network_bytes_total{instance=~\"$env\"}[$interval])",
              "format": "time_series",
              "hide": true,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{state}}",
              "metric": "mongodb_metrics_operation_total",
              "refId": "C",
              "step": 240,
              "target": "keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.net_out_bytes, 10)",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Network I/O",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "decbytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 41,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "mongodb_replset_oplog_size_bytes{instance=~\"$env\"}",
              "format": "time_series",
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{type}}",
              "metric": "mongodb_locks_time_acquiring_global_microseconds_total",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.$region*.$region-mongo*.mongodb.*.open_connections, 10), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": true
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Open Connections",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 1,
          "id": 42,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "refId": "B",
              "target": "aliasSub(keepLastValue(infrastructure.*.$region*.$region-mongo*.system.load5, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "5 Min Load",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": true,
      "title": "Resource Metrics",
      "titleSize": "h4"
    },
    {
      "collapse": false,
      "height": 250,
      "panels": [
        {
          "alert": {
            "conditions": [
              {
                "evaluator": {
                  "params": [
                    300
                  ],
                  "type": "gt"
                },
                "operator": {
                  "type": "and"
                },
                "query": {
                  "params": [
                    "A",
                    "15m",
                    "now"
                  ]
                },
                "reducer": {
                  "params": [],
                  "type": "avg"
                },
                "type": "query"
              }
            ],
            "executionErrorState": "keep_state",
            "frequency": "60s",
            "handler": 1,
            "message": "A MongoDB oplog replication has been 5 minutes behind in its replication for more than 15 minutes.\nBeing able to fail over to a replica of your data is only useful if the data is up to date, so you need to know when that’s no longer the case!",
            "name": "MongoDB Oplog lag alert",
            "noDataState": "no_data",
            "notifications": [
              {
                "id": 2
              }
            ]
          },
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "description": "",
          "fill": 1,
          "id": 16,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": true,
            "min": true,
            "rightSide": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(mongodb_replset_oplog_head_timestamp[5m])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{instance}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.prd_data.prd-mongo*.mongodb.*.repl_lag, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": true
            },
            {
              "expr": "rate(mongodb_replset_oplog_head_timestamp[5m])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{instance}}",
              "refId": "B",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.uat_data.uat-mongo*.mongodb.*.repl_lag, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": true
            },
            {
              "expr": "rate(mongodb_replset_oplog_head_timestamp[5m])",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{instance}}",
              "refId": "C",
              "step": 240,
              "target": "aliasSub(keepLastValue(infrastructure.eu-west-1.tst_data.tst-mongo*.mongodb.*.repl_lag, 5), '.*_data.(.*?)_.*', '\\1')",
              "textEditor": true
            }
          ],
          "thresholds": [
            {
              "colorMode": "critical",
              "fill": true,
              "line": true,
              "op": "gt",
              "value": 300
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Oplog Replication Lag",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "dtdurations",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        },
        {
          "alert": {
            "conditions": [
              {
                "evaluator": {
                  "params": [
                    98
                  ],
                  "type": "gt"
                },
                "operator": {
                  "type": "and"
                },
                "query": {
                  "params": [
                    "B",
                    "5m",
                    "now"
                  ]
                },
                "reducer": {
                  "params": [],
                  "type": "avg"
                },
                "type": "query"
              }
            ],
            "executionErrorState": "keep_state",
            "frequency": "60s",
            "handler": 1,
            "message": "MongoDB's average disk i/o utilization has been above 98% for 5 minutes",
            "name": "MongoDB's Disk IO Utilization alert",
            "noDataState": "ok",
            "notifications": [
              {
                "id": 2
              }
            ]
          },
          "aliasColors": {
            "prd-mongo0 dm-0": "#64b0c8",
            "prd-mongo0 nvme0n1": "#64b0c8",
            "prd-mongo0 nvme0n1p1": "#64b0c8",
            "prd-mongo0 nvme1n1": "#64b0c8",
            "prd-mongo0 nvme2n1": "#64b0c8",
            "prd-mongo1 dm-0": "#cca300",
            "prd-mongo1 nvme0n1": "#cca300",
            "prd-mongo1 nvme0n1p1": "#cca300",
            "prd-mongo1 nvme1n1": "#cca300",
            "prd-mongo2 dm-0": "#e24d42",
            "prd-mongo2 nvme0n1": "#e24d42",
            "prd-mongo2 nvme0n1p1": "#e24d42",
            "prd-mongo2 nvme1n1": "#e24d42",
            "prd-mongo2 nvme2n1": "#e24d42"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "description": "Hardcoded to show prd, alerts dont work with template variables.\n\nFor reference on getting percent value:",
          "fill": 0,
          "id": 17,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "hideZero": false,
            "max": true,
            "min": true,
            "rightSide": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [
            {
              "targetBlank": true,
              "title": "diskio telegraf plugin",
              "type": "absolute",
              "url": "https://github.com/influxdata/telegraf/tree/master/plugins/inputs/diskio"
            },
            {
              "targetBlank": true,
              "title": "how to calculate IO utilization",
              "type": "absolute",
              "url": "https://github.com/influxdata/telegraf/issues/1007#issuecomment-321297647"
            }
          ],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "(rate(node_disk_io_time_ms{instance=~\"shr.*\"}[5m])/1000 or irate(node_disk_io_time_ms{instance=~\"shr.*\"}[5m])/1000)",
              "format": "time_series",
              "hide": false,
              "interval": "",
              "intervalFactor": 2,
              "legendFormat": "{{device}} - {{instance}}",
              "refId": "B",
              "step": 240,
              "target": "aliasSub(asPercent(perSecond(infrastructure.eu-west-1.prd_data.prd-mongo*.diskio.*.io_time), 1000), '.*_data\\.([^_]*?)_.*diskio\\.([^.]*).*', '\\1 \\2')",
              "textEditor": true
            }
          ],
          "thresholds": [
            {
              "colorMode": "critical",
              "fill": true,
              "line": true,
              "op": "gt",
              "value": 98
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Disk IO Utilization (prd only)",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "percent",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": true,
      "title": "Alerts",
      "titleSize": "h4"
    },
    {
      "collapse": false,
      "height": 250,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 0,
          "id": 18,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(node_disk_reads_completed{instance=~\"shr.*\"}[5m])",
              "format": "time_series",
              "intervalFactor": 2,
              "legendFormat": "{{device}} - {{instance}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(perSecond(infrastructure.eu-west-1.$region*.$region-mongo*.diskio.*.reads), '.*_data\\.([^_]*?)_.*diskio\\.([^.]*).*', '\\1 \\2')",
              "textEditor": true
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Disk Reads Completed (Per Second)",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PAAS_METRICS}",
          "fill": 0,
          "id": 19,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "span": 6,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "rate(node_disk_writes_completed{instance=~\"shr.*\"}[5m])",
              "format": "time_series",
              "intervalFactor": 2,
              "legendFormat": "{{device}} - {{instance}}",
              "refId": "A",
              "step": 240,
              "target": "aliasSub(perSecond(infrastructure.eu-west-1.$region*.$region-mongo*.diskio.*.writes), '.*_data\\.([^_]*?)_.*diskio\\.([^.]*).*', '\\1 \\2')",
              "textEditor": true
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Disk Writes Completed (Per Second)",
          "tooltip": {
            "shared": false,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    }
  ],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "prd",
          "value": "prd"
        },
        "hide": 0,
        "includeAll": false,
        "label": "region",
        "multi": false,
        "name": "region",
        "options": [
          {
            "selected": true,
            "text": "prd",
            "value": "prd"
          },
          {
            "selected": false,
            "text": "uat",
            "value": "uat"
          },
          {
            "selected": false,
            "text": "tst",
            "value": "tst"
          }
        ],
        "query": "prd,uat,tst",
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Mongo",
  "version": 16
}