Grafana dashboard: Pagespeed Exporter
Description: Simple dashboard for the pagespeed exporter from
https://github.com/foomo/pagespeed_exporter
(I'm not foomo. If you are, thanks!)

Dashboard for https://github.com/foomo/pagespeed_exporter

Assumes the job is "pagespeed_exporter"

Thanks to foomo for the exporter!

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS_PRO",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.1.3"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": "5.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 8328,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1539349997045,
  "links": [],
  "panels": [
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS_PRO}",
      "format": "percent",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 7,
      "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"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "pagespeed_rulegroup_usability_score{job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}\n",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "60,80",
      "title": "Usability Score",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS_PRO}",
      "format": "percent",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "id": 8,
      "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"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "pagespeed_rulegroup_speed_score{job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}\n",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "33,67",
      "title": "Speed Score",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS_PRO}",
      "description": "Number of response bytes for: \n - flash\n - main HTML document and all iframes (uncompressed)\n - CSS (uncompressed)\n - images\n - JS(uncompressed)\n - other\n - text resources not covered by other statistics (i.e non-HTML, non-script, non-CSS resources)(uncompressed)",
      "fill": 1,
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 4
      },
      "id": 4,
      "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,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(pagespeed_pagestats_javascript_response_bytes{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "js",
          "refId": "D"
        },
        {
          "expr": "sum(pagespeed_pagestats_image_response_bytes{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "images",
          "refId": "C"
        },
        {
          "expr": "sum(pagespeed_pagestats_html_response_bytes{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "HTML",
          "refId": "A"
        },
        {
          "expr": "sum(pagespeed_pagestats_text_response_bytes{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "text",
          "refId": "F"
        },
        {
          "expr": "sum(pagespeed_pagestats_css_response_bytes{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "css",
          "refId": "H"
        },
        {
          "expr": "sum(pagespeed_pagestats_flash_response_bytes{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "flash",
          "refId": "B"
        },
        {
          "expr": "sum(pagespeed_pagestats_other_response_bytes{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "other",
          "refId": "E"
        },
        {
          "expr": "sum(pagespeed_pagestats_total_response_bytes{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "hide": true,
          "intervalFactor": 1,
          "legendFormat": "total",
          "refId": "G"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Response Size (stacked)",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "bytes",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS_PRO}",
      "description": "Number of resources loaded by the page",
      "fill": 1,
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 14
      },
      "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,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(pagespeed_pagestats_js_resources{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "js",
          "refId": "C"
        },
        {
          "expr": "sum(pagespeed_pagestats_http_resources{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "http",
          "refId": "A"
        },
        {
          "expr": "sum(pagespeed_pagestats_css_resources{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "css",
          "refId": "B"
        },
        {
          "expr": "sum(pagespeed_pagestats_static_resources{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"}) \n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "static",
          "refId": "D"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Resources",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 0,
          "format": "none",
          "label": "resources",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS_PRO}",
      "description": "Number of unique hosts referenced by the page",
      "fill": 1,
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 24
      },
      "id": 3,
      "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,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(pagespeed_pagestats_hosts{ job=\"pagespeed_exporter\",target=~\"$target\",strategy=~\"$strategy\"})\n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "$target $strategy",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Hosts",
      "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": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "schemaVersion": 16,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS_PRO}",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "target",
        "options": [],
        "query": "label_values(pagespeed_pagestats_hosts{job=\"pagespeed_exporter\"},target)",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS_PRO}",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "strategy",
        "options": [],
        "query": "label_values(pagespeed_pagestats_hosts{job=\"pagespeed_exporter\"},strategy)",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "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": "Pagespeed Exporter",
  "uid": "QdilqPJik",
  "version": 1,
  "description": "Simple dashboard for the pagespeed exporter from\nhttps://github.com/foomo/pagespeed_exporter\n(I'm not foomo. If you are, thanks!)"
}