Grafana dashboard: Presto Query Log
Description: See README

Note: Self-use purpose.

Presto logging exporter: https://github.com/archongum/presto-querylog

Collector: Logstash. logstash configuration and ES index template is in the `ArNote/logstash` folder.

{
  "__inputs": [
    {
      "name": "DS_PRESTO_QUERY_LOG",
      "label": "presto_query_log",
      "description": "",
      "type": "datasource",
      "pluginId": "elasticsearch",
      "pluginName": "Elasticsearch"
    }
  ],
  "__requires": [
    {
      "type": "datasource",
      "id": "elasticsearch",
      "name": "Elasticsearch",
      "version": "1.0.0"
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.1.6"
    },
    {
      "type": "panel",
      "id": "grafana-clock-panel",
      "name": "Clock",
      "version": "1.0.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "panel",
      "id": "heatmap",
      "name": "Heatmap",
      "version": ""
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "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": 11413,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1576465308690,
  "links": [],
  "panels": [
    {
      "bgColor": null,
      "clockType": "24 hour",
      "countdownSettings": {
        "customFormat": null,
        "endCountdownTime": "2019-10-31T10:09:00.000Z",
        "endText": "00:00:00"
      },
      "dateSettings": {
        "dateFormat": "YYYY-MM-DD",
        "fontSize": "20px",
        "fontWeight": "normal",
        "showDate": false
      },
      "gridPos": {
        "h": 3,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 16,
      "links": [],
      "mode": "time",
      "offsetFromUtc": null,
      "offsetFromUtcMinutes": null,
      "refreshSettings": {
        "syncWithDashboard": false
      },
      "targets": [
        {
          "expr": "",
          "format": "time_series",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeSettings": {
        "customFormat": "HH:mm:ss",
        "fontSize": "60px",
        "fontWeight": "normal"
      },
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "grafana-clock-panel"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 8,
        "w": 4,
        "x": 0,
        "y": 3
      },
      "id": 4,
      "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": true
      },
      "tableColumn": "",
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "createTime",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "host:$Host",
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Query Total",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 20,
        "x": 4,
        "y": 3
      },
      "id": 2,
      "legend": {
        "avg": true,
        "current": false,
        "max": true,
        "min": false,
        "show": true,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "maxPerRow": 3,
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "repeatDirection": "h",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "createTime",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "type": "count"
            }
          ],
          "query": "host:$Host",
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Query 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
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "cacheTimeout": null,
      "columns": [],
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "fontSize": "100%",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 11
      },
      "id": 7,
      "links": [],
      "pageSize": null,
      "pluginVersion": "6.1.6",
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 2,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "",
          "colorMode": "cell",
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "decimals": 2,
          "pattern": "/.*/",
          "thresholds": [
            "1000"
          ],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "alias": "1",
          "bucketAggs": [
            {
              "fake": true,
              "field": "host",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "fake": true,
              "field": "inputMetaDataList.catalogName",
              "id": "4",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "field": "statistics.outputMB",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "count"
            }
          ],
          "query": "",
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "User Query Count",
      "transform": "table",
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "columns": [],
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "fontSize": "100%",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 11
      },
      "id": 6,
      "links": [],
      "pageSize": null,
      "pluginVersion": "6.1.6",
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 2,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "",
          "colorMode": "cell",
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "decimals": 2,
          "pattern": "/.*/",
          "thresholds": [
            "1000"
          ],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "alias": "1",
          "bucketAggs": [
            {
              "fake": true,
              "field": "host",
              "id": "3",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "fake": true,
              "field": "context.user",
              "id": "4",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "field": "statistics.outputMB",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "count"
            }
          ],
          "query": "",
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "User Query Count",
      "transform": "table",
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateOranges",
        "exponent": 0.5,
        "mode": "opacity"
      },
      "dataFormat": "timeseries",
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 11
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 11,
      "legend": {
        "show": false
      },
      "links": [],
      "reverseYBuckets": false,
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "createTime",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "statistics.queuedSecond",
              "id": "1",
              "meta": {},
              "pipelineAgg": "select metric",
              "settings": {
                "percents": [
                  25,
                  50,
                  75,
                  95,
                  99
                ]
              },
              "type": "percentiles"
            }
          ],
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Queued Time",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "cacheTimeout": null,
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateOranges",
        "exponent": 0.5,
        "mode": "opacity"
      },
      "dataFormat": "timeseries",
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 19
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 9,
      "legend": {
        "show": false
      },
      "links": [],
      "reverseYBuckets": false,
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "createTime",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "statistics.wallSecond",
              "id": "1",
              "meta": {},
              "pipelineAgg": "select metric",
              "settings": {
                "percents": [
                  25,
                  50,
                  75,
                  95,
                  99
                ]
              },
              "type": "percentiles"
            }
          ],
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Wall Time",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "cacheTimeout": null,
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateOranges",
        "exponent": 0.5,
        "mode": "opacity"
      },
      "dataFormat": "timeseries",
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 19
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 12,
      "legend": {
        "show": false
      },
      "links": [],
      "reverseYBuckets": false,
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "createTime",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "statistics.cpuSecond",
              "id": "1",
              "meta": {},
              "pipelineAgg": "select metric",
              "settings": {
                "percents": [
                  25,
                  50,
                  75,
                  95,
                  99
                ]
              },
              "type": "percentiles"
            }
          ],
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "CPU Time",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "cacheTimeout": null,
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateOranges",
        "exponent": 0.5,
        "mode": "opacity"
      },
      "dataFormat": "timeseries",
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 19
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 10,
      "legend": {
        "show": false
      },
      "links": [],
      "reverseYBuckets": false,
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "createTime",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "statistics.analysisSecond",
              "id": "1",
              "meta": {},
              "pipelineAgg": "select metric",
              "settings": {
                "percents": [
                  25,
                  50,
                  75,
                  95,
                  99
                ]
              },
              "type": "percentiles"
            }
          ],
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Analysis Time",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "cacheTimeout": null,
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateOranges",
        "exponent": 0.5,
        "mode": "spectrum"
      },
      "dataFormat": "timeseries",
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 27
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 14,
      "legend": {
        "show": false
      },
      "links": [],
      "reverseYBuckets": false,
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "createTime",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "statistics.internalNetworkRows",
              "id": "1",
              "meta": {},
              "pipelineAgg": "select metric",
              "settings": {
                "percents": [
                  25,
                  50,
                  75,
                  95,
                  99
                ]
              },
              "type": "percentiles"
            }
          ],
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "internalNetworkRows",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    },
    {
      "cacheTimeout": null,
      "cards": {
        "cardPadding": null,
        "cardRound": null
      },
      "color": {
        "cardColor": "#b4ff00",
        "colorScale": "sqrt",
        "colorScheme": "interpolateOranges",
        "exponent": 0.5,
        "mode": "spectrum"
      },
      "dataFormat": "timeseries",
      "datasource": "${DS_PRESTO_QUERY_LOG}",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 27
      },
      "heatmap": {},
      "hideZeroBuckets": false,
      "highlightCards": true,
      "id": 13,
      "legend": {
        "show": false
      },
      "links": [],
      "reverseYBuckets": false,
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "createTime",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "field": "statistics.totalRows",
              "id": "1",
              "meta": {},
              "pipelineAgg": "select metric",
              "settings": {
                "percents": [
                  25,
                  50,
                  75,
                  95,
                  99
                ]
              },
              "type": "percentiles"
            }
          ],
          "refId": "A",
          "timeField": "createTime"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Total Rows",
      "tooltip": {
        "show": true,
        "showHistogram": false
      },
      "type": "heatmap",
      "xAxis": {
        "show": true
      },
      "xBucketNumber": null,
      "xBucketSize": null,
      "yAxis": {
        "decimals": null,
        "format": "short",
        "logBase": 1,
        "max": null,
        "min": null,
        "show": true,
        "splitFactor": null
      },
      "yBucketBound": "auto",
      "yBucketNumber": null,
      "yBucketSize": null
    }
  ],
  "refresh": false,
  "schemaVersion": 18,
  "style": "dark",
  "tags": [
    "presto",
    "log"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PRESTO_QUERY_LOG}",
        "definition": "{\"find\": \"terms\", \"field\": \"host\"}",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "Host",
        "options": [],
        "query": "{\"find\": \"terms\", \"field\": \"host\"}",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "datasource": "presto_query_log",
        "filters": [],
        "hide": 0,
        "label": "",
        "name": "Filters",
        "skipUrlSync": false,
        "type": "adhoc"
      }
    ]
  },
  "time": {
    "from": "now-24h",
    "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": "Presto Query Log",
  "uid": "0d8DB0AZz",
  "version": 14,
  "description": "See README"
}