Grafana dashboard: Mongo overview
Description: Should display mongodb overview for telegraf 1.5


{
  "__inputs": [
    {
      "name": "DS_PROM",
      "label": "prom",
      "description": "at least  telegraf 1.5",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "4.6.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "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"
      }
    ]
  },
  "editable": true,
  "gnetId": 4077,
  "graphTooltip": 0,
  "hideControls": false,
  "id": null,
  "links": [],
  "rows": [
    {
      "collapse": false,
      "height": 239,
      "panels": [
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_PROM}",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 1,
          "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": 3,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "host",
          "targets": [
            {
              "expr": "mongodb_inserts_per_sec{state=\"PRIMARY\", env=\"$env\"}",
              "format": "table",
              "instant": false,
              "intervalFactor": 2,
              "legendFormat": "{{host}}",
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Current master",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "avg"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "datasource": "${DS_PROM}",
          "editable": true,
          "error": false,
          "format": "s",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 2,
          "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": 3,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": true,
            "lineColor": "rgb(31, 120, 193)",
            "show": true
          },
          "tableColumn": "",
          "targets": [
            {
              "dsType": "influxdb",
              "expr": "exec_mongoext_timeDiff{env=\"$env\"}",
              "format": "time_series",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "intervalFactor": 2,
              "measurement": "exec_mongoext",
              "metric": "exec_mongoext_timeDiff",
              "policy": "default",
              "query": "",
              "rawQuery": false,
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "timeDiff"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "step": 60,
              "tags": [
                {
                  "key": "env",
                  "operator": "=~",
                  "value": "/^$env$/"
                }
              ]
            }
          ],
          "thresholds": "",
          "title": "Mongo Oplog",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "current"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_PROM}",
          "format": "none",
          "gauge": {
            "maxValue": 128,
            "minValue": 0,
            "show": true,
            "thresholdLabels": true,
            "thresholdMarkers": true
          },
          "id": 3,
          "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": 3,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": true,
            "lineColor": "rgb(31, 120, 193)",
            "show": true
          },
          "tableColumn": "",
          "targets": [
            {
              "expr": "mongodb_active_writes{env=\"$env\", state=\"PRIMARY\"}",
              "format": "time_series",
              "instant": false,
              "intervalFactor": 2,
              "refId": "A"
            }
          ],
          "thresholds": "50,90",
          "title": "Current Writes Queue to Master",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "avg"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROM}",
          "fill": 1,
          "id": 4,
          "legend": {
            "avg": true,
            "current": false,
            "max": false,
            "min": false,
            "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": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "mongodb_active_reads{env=\"$env\"}",
              "format": "time_series",
              "intervalFactor": 2,
              "legendFormat": "Reads: {{host}}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Reads",
          "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
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 476,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROM}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {},
          "id": 5,
          "interval": "10s",
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": false,
            "min": false,
            "show": true,
            "sortDesc": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "minSpan": 3,
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "repeat": "host",
          "seriesOverrides": [
            {
              "alias": "active_writes",
              "transform": "negative-Y"
            }
          ],
          "spaceLength": 10,
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "commands_per_sec $tag_host",
              "dsType": "influxdb",
              "expr": "mongodb_inserts_per_sec{env=\"$env\", host=~\"$host\"}",
              "format": "time_series",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "host"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "intervalFactor": 2,
              "legendFormat": "Inserts ",
              "measurement": "mongodb",
              "metric": "mongodb_inserts_per_sec",
              "policy": "default",
              "query": "SELECT mean(\"commands_per_sec\") FROM \"mongodb\" WHERE \"hostname\" = '127.0.0.1:27017' AND $timeFilter GROUP BY time($interval) fill(null)",
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "commands_per_sec"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "step": 20,
              "tags": [
                {
                  "key": "env",
                  "operator": "=~",
                  "value": "/^$env$/"
                }
              ]
            },
            {
              "alias": "deletes_per_sec $tag_host",
              "dsType": "influxdb",
              "expr": "mongodb_queries_per_sec{env=\"$env\", host=~\"$host\"}",
              "format": "time_series",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "host"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "intervalFactor": 2,
              "legendFormat": "Queries ",
              "measurement": "mongodb",
              "metric": "mongodb_queries_per_sec",
              "policy": "default",
              "query": "SELECT mean(\"deletes_per_sec\") FROM \"mongodb\" WHERE \"hostname\" = '127.0.0.1:27017' AND $timeFilter GROUP BY time($interval) fill(null)",
              "refId": "B",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "deletes_per_sec"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "step": 20,
              "tags": [
                {
                  "key": "env",
                  "operator": "=~",
                  "value": "/^$env$/"
                }
              ]
            },
            {
              "alias": "flushes_per_sec $tag_host",
              "dsType": "influxdb",
              "expr": "mongodb_updates_per_sec{env=\"$env\", host=~\"$host\"}",
              "format": "time_series",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "host"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "intervalFactor": 2,
              "legendFormat": "Updates",
              "measurement": "mongodb",
              "metric": "mongodb_updates_per_sec",
              "policy": "default",
              "query": "SELECT mean(\"flushes_per_sec\") FROM \"mongodb\" WHERE \"hostname\" = '127.0.0.1:27017' AND $timeFilter GROUP BY time($interval) fill(null)",
              "refId": "C",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "flushes_per_sec"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "step": 20,
              "tags": [
                {
                  "key": "env",
                  "operator": "=~",
                  "value": "/^$env$/"
                }
              ]
            },
            {
              "alias": "getmores_per_sec $tag_host",
              "dsType": "influxdb",
              "expr": "mongodb_commands_per_sec{env=\"$env\", host=~\"$host\"}",
              "format": "time_series",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "host"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "intervalFactor": 2,
              "legendFormat": "Commands",
              "measurement": "mongodb",
              "metric": "mongodb_commands_per_sec",
              "policy": "default",
              "query": "SELECT mean(\"getmores_per_sec\") FROM \"mongodb\" WHERE \"hostname\" = '127.0.0.1:27017' AND $timeFilter GROUP BY time($interval) fill(null)",
              "refId": "D",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "getmores_per_sec"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "step": 20,
              "tags": [
                {
                  "key": "env",
                  "operator": "=~",
                  "value": "/^$env$/"
                }
              ]
            },
            {
              "alias": "inserts_per_sec $tag_host",
              "dsType": "influxdb",
              "expr": "mongodb_flushes_per_sec{env=\"$env\", host=~\"$host\"}",
              "format": "time_series",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "host"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "intervalFactor": 2,
              "legendFormat": "Flushes",
              "measurement": "mongodb",
              "metric": "mongodb_flushes_per_sec",
              "policy": "default",
              "query": "SELECT mean(\"inserts_per_sec\") FROM \"mongodb\" WHERE \"hostname\" = '127.0.0.1:27017' AND $timeFilter GROUP BY time($interval) fill(null)",
              "refId": "E",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "inserts_per_sec"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "step": 20,
              "tags": [
                {
                  "key": "env",
                  "operator": "=~",
                  "value": "/^$env$/"
                }
              ]
            },
            {
              "alias": "queries_per_sec $tag_host",
              "dsType": "influxdb",
              "expr": "mongodb_getmores_per_sec{env=\"$env\", host=~\"$host\"}",
              "format": "time_series",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "host"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "intervalFactor": 2,
              "legendFormat": "Getmores",
              "measurement": "mongodb",
              "metric": "mongodb_getmores_per_sec",
              "policy": "default",
              "query": "SELECT mean(\"queries_per_sec\") FROM \"mongodb\" WHERE \"hostname\" = '127.0.0.1:27017' AND $timeFilter GROUP BY time($interval) fill(null)",
              "refId": "F",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "queries_per_sec"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "step": 20,
              "tags": [
                {
                  "key": "env",
                  "operator": "=~",
                  "value": "/^$env$/"
                }
              ]
            },
            {
              "alias": "updates_per_sec $tag_host",
              "dsType": "influxdb",
              "expr": "mongodb_deletes_per_sec{env=\"$env\", host=~\"$host\"}",
              "format": "time_series",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "host"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "intervalFactor": 2,
              "legendFormat": "Deletes",
              "measurement": "mongodb",
              "metric": "mongodb_deletes_per_sec",
              "policy": "default",
              "query": "SELECT mean(\"queries_per_sec\") FROM \"mongodb\" WHERE \"hostname\" = '127.0.0.1:27017' AND $timeFilter GROUP BY time($interval) fill(null)",
              "refId": "G",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "updates_per_sec"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "step": 20,
              "tags": [
                {
                  "key": "env",
                  "operator": "=~",
                  "value": "/^$env$/"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "mongo operations $host",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ops",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "format": "short",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 250,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROM}",
          "fill": 1,
          "id": 8,
          "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": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "mongodb_open_connections{env=\"$env\"}",
              "format": "time_series",
              "intervalFactor": 2,
              "legendFormat": "{{host}}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Connection count",
          "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
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    }
  ],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROM}",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "env",
        "options": [],
        "query": "label_values(env)",
        "refresh": 1,
        "regex": "",
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROM}",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "host",
        "options": [],
        "query": "label_values(mongodb_inserts_per_sec{env=\"$env\"},host)",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "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": "",
  "title": "Mongo overview",
  "version": 8,
  "description": "Should display mongodb overview for telegraf 1.5"
}