Grafana dashboard: Internal Grafana Stats (Prometheus)
Description: Data Proxy request timings (percentiles), dashboard loads, logins etc, Prometheus version.

This is a version of the official [Internal Grafana Stats](https://grafana.net/dashboards/55) dashboard, modified to use data from Prometheus. The data should be scraped into Prometheus using the [graphite exporter](https://github.com/prometheus/graphite_exporter) with the following mapping:

```
grafana.*.api.dataproxy.request.*.count
name="grafana_api_proxy_requests"
instance="$1"
group="$2"
job="grafana"

grafana.*.api.dataproxy.request.*.min
name="grafana_api_proxy_request_duration_seconds_min"
instance="$1"
group="$2"
job="grafana"

grafana.*.api.dataproxy.request.*.max
name="grafana_api_proxy_request_duration_seconds_max"
instance="$1"
group="$2"
job="grafana"

grafana.*.api.dataproxy.request.*.mean
name="grafana_api_proxy_request_duration_seconds_mean"
instance="$1"
group="$2"
job="grafana"

grafana.*.api.dataproxy.request.*.std
name="grafana_api_proxy_request_duration_seconds_std"
instance="$1"
group="$2"
job="grafana"

grafana.*.api.*.*.count
name="grafana_api_requests"
instance="$1"
endpoint="$2"
action="$3"
job="grafana"

grafana.*.api.*.*.min
name="grafana_api_request_duration_seconds_min"
instance="$1"
endpoint="$2"
action="$3"
job="grafana"

grafana.*.api.*.*.max
name="grafana_api_request_duration_seconds_max"
instance="$1"
endpoint="$2"
action="$3"
job="grafana"

grafana.*.api.*.*.mean
name="grafana_api_request_duration_seconds_mean"
instance="$1"
endpoint="$2"
action="$3"
job="grafana"

grafana.*.api.*.*.std
name="grafana_api_request_duration_seconds_std"
instance="$1"
endpoint="$2"
action="$3"
job="grafana"

grafana.*.instance_start.count
name="grafana_instance_starts"
instance="$1"
job="grafana"

grafana.*.models.*.*.count
name="grafana_db_events"
instance="$1"
model="$2"
action="$3"
job="grafana"
```


{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "3.1.1"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    }
  ],
  "id": null,
  "title": "Internal Grafana Stats (Prometheus)",
  "description": "Data Proxy request timings (percentiles), dashboard loads, logins etc, Prometheus version.",
  "tags": [],
  "style": "dark",
  "timezone": "browser",
  "editable": true,
  "hideControls": false,
  "sharedCrosshair": false,
  "rows": [
    {
      "collapse": false,
      "editable": true,
      "height": "250px",
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 3,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 7,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "grafana_api_proxy_request_duration_seconds_min{instance=\"$server\"}",
              "intervalFactor": 2,
              "legendFormat": "min",
              "metric": "grafana_api_requests",
              "refId": "A",
              "step": 2,
              "target": "aliasByNode($prefix.$server.api.dataproxy.request.all.p*, 5)"
            },
            {
              "expr": "grafana_api_proxy_request_duration_seconds_mean{instance=\"$server\"}",
              "intervalFactor": 2,
              "legendFormat": "mean",
              "metric": "grafana_api_requests",
              "refId": "B",
              "step": 2,
              "target": "aliasByNode($prefix.$server.api.dataproxy.request.all.p*, 5)"
            },
            {
              "expr": "grafana_api_proxy_request_duration_seconds_max{instance=\"$server\"}",
              "intervalFactor": 2,
              "legendFormat": "max",
              "metric": "grafana_api_requests",
              "refId": "C",
              "step": 2,
              "target": "aliasByNode($prefix.$server.api.dataproxy.request.all.p*, 5)"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Data Proxy Request Times (log base 10 scale)",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 2,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "ms",
              "label": null,
              "logBase": 10,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {
            "all": "#1F78C1"
          },
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 4,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 5,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "irate(grafana_api_proxy_requests{instance=\"$server\"}[1m])",
              "intervalFactor": 2,
              "legendFormat": "request",
              "metric": "grafana_api_proxy_requests",
              "refId": "A",
              "step": 4,
              "target": "aliasByNode(scaleToSeconds($prefix.$server.api.dataproxy.request.all.count, 1), 4)",
              "textEditor": false
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Data Proxy Requests / s",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "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
            }
          ]
        }
      ],
      "title": "New row"
    },
    {
      "collapse": false,
      "editable": true,
      "height": "200px",
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 1,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 7,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "refId": "A",
              "target": "aliasByNode($prefix.$server.api.dashboard.search.p*, 4)",
              "textEditor": false,
              "expr": "grafana_api_request_duration_seconds_min{instance=\"$server\",endpoint=\"dashboard\",action=\"search\"}",
              "intervalFactor": 2,
              "metric": "grafana_api_request_duration_seconds_min",
              "step": 2,
              "legendFormat": "min"
            },
            {
              "refId": "B",
              "target": "aliasByNode($prefix.$server.api.dashboard.search.p*, 4)",
              "textEditor": false,
              "expr": "grafana_api_request_duration_seconds_mean{instance=\"$server\",endpoint=\"dashboard\",action=\"search\"}",
              "intervalFactor": 2,
              "metric": "grafana_api_request_duration_seconds_min",
              "step": 2,
              "legendFormat": "mean"
            },
            {
              "refId": "C",
              "target": "aliasByNode($prefix.$server.api.dashboard.search.p*, 4)",
              "textEditor": false,
              "expr": "grafana_api_request_duration_seconds_max{instance=\"$server\",endpoint=\"dashboard\",action=\"search\"}",
              "intervalFactor": 2,
              "metric": "grafana_api_request_duration_seconds_min",
              "step": 2,
              "legendFormat": "max"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Dashboard Search Time",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "ms",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {
            "count": "#EAB839"
          },
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 2,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 5,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "refId": "A",
              "target": "aliasByNode(scaleToSeconds($prefix.$server.api.dashboard.search.count, 1), 4)",
              "textEditor": false,
              "expr": "irate(grafana_api_requests{instance=\"$server\",endpoint=\"dashboard\",action=\"search\"}[1m])",
              "intervalFactor": 2,
              "metric": "grafana_api_requests",
              "step": 4
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Dashboard Search Req / s",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "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
            }
          ]
        }
      ],
      "title": "Row"
    },
    {
      "collapse": false,
      "editable": true,
      "height": "200px",
      "panels": [
        {
          "aliasColors": {
            "mean": "#6ED0E0"
          },
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 5,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": false,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "alias": "count",
              "yaxis": 1
            }
          ],
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "refId": "A",
              "target": "aliasByNode($prefix.$server.api.dashboard.save.mean, 4)",
              "textEditor": false,
              "expr": "grafana_api_request_duration_seconds_mean{instance=\"$server\",endpoint=\"dashboard\",action=\"save\"}",
              "intervalFactor": 2,
              "step": 4,
              "legendFormat": ""
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Dashboard Save Time",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "ms",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {
            "mean": "#EAB839"
          },
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 6,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": false,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "alias": "count",
              "yaxis": 1
            }
          ],
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "refId": "A",
              "target": "aliasByNode($prefix.$server.api.dashboard.get.mean, 4)",
              "textEditor": false,
              "expr": "grafana_api_request_duration_seconds_mean{instance=\"$server\",endpoint=\"dashboard\",action=\"get\"}",
              "intervalFactor": 2,
              "step": 4
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Dashboard Get Time",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "ms",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {
            "summarize(sumSeries(internal.api.login.*.count), \"10min\", \"sum\")": "#508642",
            "summarize(sumSeries(internal.api.login.*.count), \"5min\", \"sum\")": "#1F78C1"
          },
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 7,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": false,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "alias": "count",
              "yaxis": 1
            }
          ],
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "refId": "A",
              "target": "alias(summarize(sumSeries($prefix.$server.api.login.*.count), '10min', 'sum', false), 'logins')",
              "textEditor": false,
              "expr": "sum(sum_over_time(grafana_api_requests{instance=\"$server\",endpoint=\"login\"}[10m]))",
              "intervalFactor": 2,
              "metric": "grafana_api_requests",
              "step": 4,
              "legendFormat": ""
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Logins / 10min",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {
            "summarize(sumSeries(internal.api.dashboard.get.count), \"10min\", \"sum\")": "#EF843C",
            "summarize(sumSeries(internal.api.login.*.count), \"5min\", \"sum\")": "#1F78C1"
          },
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 8,
          "isNew": true,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": false,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "alias": "count",
              "yaxis": 1
            }
          ],
          "span": 3,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "refId": "A",
              "target": "alias(summarize(sumSeries($prefix.$server.api.dashboard.get.count), '10min', 'sum', false), 'dashboard loads')",
              "textEditor": false,
              "expr": "sum(sum_over_time(grafana_api_requests{instance=\"$server\",endpoint=\"dashboard\",action=\"get\"}[10m]))",
              "intervalFactor": 2,
              "step": 4
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Dashboard Loads / 10min",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "title": "New row"
    }
  ],
  "time": {
    "from": "now-15m",
    "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"
    ]
  },
  "templating": {
    "list": [
      {
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "server",
        "options": [],
        "query": "label_values(instance)",
        "refresh": 1,
        "type": "query"
      }
    ]
  },
  "annotations": {
    "list": []
  },
  "refresh": false,
  "schemaVersion": 12,
  "version": 9,
  "links": [],
  "gnetId": 411
}