Grafana dashboard: Hydrolix - Query Monitoring

Hydrolix dashboard allowing users to monitor and debug query performances leveraging Hydrolix logs.

{
  "__inputs": [
    {
      "name": " DS_HYDROLIX_PROMETHEUS",
      "label": "Prometheus-Hydrolix",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    },
    {
      "name": " DS_HYDROLIX_DATABASE",
      "label": "Hydrolix-Database",
      "description": "",
      "type": "datasource",
      "pluginId": "grafana-clickhouse-datasource",
      "pluginName": "ClickHouse"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.4.7"
    },
    {
      "type": "datasource",
      "id": "grafana-clickhouse-datasource",
      "name": "ClickHouse",
      "version": "3.0.0"
    },
    {
      "type": "panel",
      "id": "heatmap",
      "name": "Heatmap",
      "version": ""
    },
    {
      "type": "panel",
      "id": "logs",
      "name": "Logs",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 17166,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${ DS_HYDROLIX_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 3,
        "x": 0,
        "y": 0
      },
      "id": 23,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ DS_HYDROLIX_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "sum by (app) (up{app=\"query-head\"})",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Query-Heads",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${ DS_HYDROLIX_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 3,
        "x": 3,
        "y": 0
      },
      "id": 24,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ DS_HYDROLIX_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "sum by (app) (up{app=\"query-peer\"})",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Query-Peers",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${ DS_HYDROLIX_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 3,
        "x": 6,
        "y": 0
      },
      "id": 22,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ DS_HYDROLIX_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "avg(increase(query_attempts_total_count{instance=~\"^$QueryHeads.*\"}[$__rate_interval]))",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Query/s",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${ DS_HYDROLIX_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 3,
        "x": 9,
        "y": 0
      },
      "id": 19,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ DS_HYDROLIX_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "avg(increase(query_health_bucket{le=\"1\",instance=~\"^$QueryHeads.*\"}[$__rate_interval]))",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Query Success Rate",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${ DS_HYDROLIX_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 3,
        "x": 12,
        "y": 0
      },
      "id": 20,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ DS_HYDROLIX_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "avg(increase(query_health_bucket{le=\"2\",instance=~\"^$QueryHeads.*\"}[$__rate_interval]))",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Query Failure Rate",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "grafana-clickhouse-datasource",
        "uid": "${ DS_HYDROLIX_DATABASE}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 3,
        "x": 15,
        "y": 0
      },
      "id": 21,
      "options": {
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": false
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "meta": {
            "builderOptions": {
              "fields": [],
              "limit": 100,
              "mode": "list"
            }
          },
          "queryType": "sql",
          "rawSql": "SELECT $__timeInterval(timestamp) as time, avg(exec_time)\r\nFROM hydro.logs\r\nWHERE component = 'query_executor'\r\nAND app = 'query-head' \r\nAND $__timeFilter_ms(timestamp) \r\nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\r\nAND $__conditionalAll($response_time, $response_time)\r\nAND $__conditionalAll(level IN ($query_status), $query_status)\r\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\r\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\r\nAND if('$filter_hydro_logs' = 1, true, query LIKE '%hydro.logs%')\r\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\r\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\r\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\r\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\r\nAND NOT empty(query)\r\nGROUP BY time ORDER BY time ASC\r\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
          "refId": "A"
        }
      ],
      "title": "Avg Query Response Time",
      "type": "gauge"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 5
      },
      "id": 32,
      "panels": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ DS_HYDROLIX_PROMETHEUS}"
          },
          "description": "General Query Rate, includes system, grafana and other queries beyond just user queries.",
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "decimals": 0,
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unit": "none"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 6
          },
          "id": 36,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "8.0.6",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ DS_HYDROLIX_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "avg(increase(query_attempts_total_count{instance=~\"^$QueryHeads.*\"}[$__rate_interval]))",
              "interval": "",
              "legendFormat": "Query Attempt Rate",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Total Query Rate",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ DS_HYDROLIX_PROMETHEUS}"
          },
          "description": "General Query Health Rate, includes system, Grafana and other queries beyond just user queries.",
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unit": "none"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 6
          },
          "id": 34,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "8.0.6",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ DS_HYDROLIX_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "avg(increase(query_health_bucket{le=\"0\", instance=~\"^$QueryHeads.*\"}[$__rate_interval]))",
              "interval": "",
              "legendFormat": "Query Initiated",
              "range": true,
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ DS_HYDROLIX_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "avg(increase(query_health_bucket{le=\"1\",instance=~\"^$QueryHeads.*\"}[$__rate_interval]))",
              "hide": false,
              "interval": "",
              "legendFormat": "Query succeeded",
              "range": true,
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ DS_HYDROLIX_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "avg(increase(query_health_bucket{le=\"2\",instance=~\"^$QueryHeads.*\"}[$__rate_interval]))",
              "hide": false,
              "interval": "",
              "legendFormat": "Query Failed",
              "range": true,
              "refId": "C"
            }
          ],
          "title": "Query Health Rate",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ DS_HYDROLIX_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 24,
            "x": 0,
            "y": 14
          },
          "id": 38,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "multi",
              "sort": "none"
            }
          },
          "pluginVersion": "8.0.6",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ DS_HYDROLIX_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum by (le)(increase(net_http_status_code_bucket{instance=~\"^$QueryPeer.*\", le != \"+Inf\"}[$__rate_interval]))",
              "interval": "",
              "legendFormat": "{{le}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "HTTP Status Code from Storage",
          "type": "timeseries"
        }
      ],
      "title": "General Query Stats",
      "type": "row"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 6
      },
      "id": 40,
      "panels": [
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "description": "Number of requests histogram bucketed per response time",
          "fieldConfig": {
            "defaults": {
              "custom": {
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "scaleDistribution": {
                  "type": "linear"
                }
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 24,
            "x": 0,
            "y": 7
          },
          "id": 26,
          "options": {
            "calculate": true,
            "cellGap": 1,
            "color": {
              "exponent": 0.5,
              "fill": "dark-orange",
              "mode": "scheme",
              "reverse": false,
              "scale": "exponential",
              "scheme": "Spectral",
              "steps": 128
            },
            "exemplars": {
              "color": "rgba(255,0,255,0.7)"
            },
            "filterValues": {
              "le": 1e-9
            },
            "legend": {
              "show": true
            },
            "rowsFrame": {
              "layout": "auto"
            },
            "tooltip": {
              "show": true,
              "yHistogram": false
            },
            "yAxis": {
              "axisPlacement": "left",
              "reverse": false,
              "unit": "ms"
            }
          },
          "pluginVersion": "9.4.7",
          "targets": [
            {
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "fields": [],
                  "limit": 100,
                  "mode": "list"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, avg(exec_time)\r\nFROM hydro.logs\r\nWHERE component = 'query_executor'\r\nAND app = 'query-head' \r\nAND $__timeFilter_ms(timestamp) \r\nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\r\nAND $__conditionalAll($response_time, $response_time)\r\nAND $__conditionalAll(level IN ($query_status), $query_status)\r\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\r\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\r\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\r\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\r\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\r\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\r\nAND NOT empty(query)\r\nGROUP BY time ORDER BY time ASC\r\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Histogram Response Time",
          "type": "heatmap"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "description": "Average Response Time",
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unit": "ms"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 24,
            "x": 0,
            "y": 16
          },
          "id": 42,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "9.4.7",
          "targets": [
            {
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "fields": [],
                  "limit": 100,
                  "mode": "list"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, avg(exec_time) as avg_exec_time\r\nFROM hydro.logs\r\nWHERE component = 'query_executor'\r\nAND app = 'query-head' \r\nAND $__timeFilter_ms(timestamp) \r\nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\r\nAND $__conditionalAll($response_time, $response_time)\r\nAND $__conditionalAll(level IN ($query_status), $query_status)\r\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\r\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\r\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\r\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\r\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\r\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\r\nAND NOT empty(query)\r\nGROUP BY time ORDER BY time ASC\r\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Average Response Time",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "description": "Query Execution time for each individual query (Ordered by Time Limit of 100 queries response)",
          "fieldConfig": {
            "defaults": {
              "custom": {
                "align": "auto",
                "cellOptions": {
                  "type": "auto"
                },
                "inspect": false
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              }
            },
            "overrides": [
              {
                "matcher": {
                  "id": "byName",
                  "options": "exec_time"
                },
                "properties": [
                  {
                    "id": "unit",
                    "value": "ms"
                  },
                  {
                    "id": "custom.width",
                    "value": 125
                  },
                  {
                    "id": "displayName",
                    "value": "Execution Time"
                  }
                ]
              },
              {
                "matcher": {
                  "id": "byName",
                  "options": "query"
                },
                "properties": [
                  {
                    "id": "custom.inspect",
                    "value": true
                  },
                  {
                    "id": "displayName",
                    "value": "Query"
                  }
                ]
              },
              {
                "matcher": {
                  "id": "byName",
                  "options": "time"
                },
                "properties": [
                  {
                    "id": "custom.width",
                    "value": 200
                  },
                  {
                    "id": "displayName",
                    "value": "Time"
                  }
                ]
              }
            ]
          },
          "gridPos": {
            "h": 9,
            "w": 24,
            "x": 0,
            "y": 25
          },
          "id": 41,
          "options": {
            "footer": {
              "countRows": false,
              "fields": "",
              "reducer": [
                "sum"
              ],
              "show": false
            },
            "showHeader": true
          },
          "pluginVersion": "9.4.7",
          "targets": [
            {
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "format": 1,
              "meta": {
                "builderOptions": {
                  "fields": [],
                  "limit": 100,
                  "mode": "list"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT timestamp as time, query, exec_time\r\nFROM hydro.logs\r\nWHERE component = 'query_executor'\r\nAND app = 'query-head' \r\nAND $__timeFilter_ms(timestamp) \r\nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\r\nAND $__conditionalAll($response_time, $response_time)\r\nAND $__conditionalAll(level IN ($query_status), $query_status)\r\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\r\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\r\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\r\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\r\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\r\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\r\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\r\nAND Not empty(query)\r\nORDER BY time DESC\r\nLIMIT 100\r\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A",
              "selectedFormat": 1
            }
          ],
          "title": "Query Execution Time (Last 100)",
          "type": "table"
        }
      ],
      "title": "Query Performance",
      "type": "row"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 7
      },
      "id": 15,
      "panels": [
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "points",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  }
                ]
              }
            },
            "overrides": [
              {
                "matcher": {
                  "id": "byName",
                  "options": "count() error"
                },
                "properties": [
                  {
                    "id": "color",
                    "value": {
                      "fixedColor": "red",
                      "mode": "fixed"
                    }
                  },
                  {
                    "id": "displayName",
                    "value": "Count Error"
                  }
                ]
              },
              {
                "matcher": {
                  "id": "byName",
                  "options": "count() info"
                },
                "properties": [
                  {
                    "id": "color",
                    "value": {
                      "fixedColor": "green",
                      "mode": "fixed"
                    }
                  },
                  {
                    "id": "displayName",
                    "value": "Count OK"
                  }
                ]
              }
            ]
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 8
          },
          "id": 2,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [],
                "filters": [
                  {
                    "condition": "AND",
                    "filterType": "custom",
                    "key": "query",
                    "operator": "IS NOT NULL",
                    "type": "Nullable(String)"
                  }
                ],
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [],
                  "filters": [
                    {
                      "condition": "AND",
                      "filterType": "custom",
                      "key": "query",
                      "operator": "IS NOT NULL",
                      "type": "Nullable(String)"
                    }
                  ],
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, count(), level\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head' \nAND $__timeFilter_ms(timestamp) \nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nGROUP BY time, level \nORDER BY time ASC\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Query Count",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "points",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  }
                ]
              },
              "unit": "ms"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 8
          },
          "id": 9,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [],
                "filters": [
                  {
                    "condition": "AND",
                    "filterType": "custom",
                    "key": "query",
                    "operator": "IS NOT NULL",
                    "type": "Nullable(String)"
                  }
                ],
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [],
                  "filters": [
                    {
                      "condition": "AND",
                      "filterType": "custom",
                      "key": "query",
                      "operator": "IS NOT NULL",
                      "type": "Nullable(String)"
                    }
                  ],
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, avg(exec_time)\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head' \nAND $__timeFilter_ms(timestamp) \nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nGROUP BY time ORDER BY time ASC\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Avg Query Exec Time",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "bars",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 16
          },
          "id": 3,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [],
                "filters": [
                  {
                    "condition": "AND",
                    "filterType": "custom",
                    "key": "query",
                    "operator": "IS NOT NULL",
                    "type": "Nullable(String)"
                  }
                ],
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [],
                  "filters": [
                    {
                      "condition": "AND",
                      "filterType": "custom",
                      "key": "query",
                      "operator": "IS NOT NULL",
                      "type": "Nullable(String)"
                    }
                  ],
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, sum(rows_read)\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head'\nAND $__timeFilter_ms(timestamp)\nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nAND NOT empty(query)\nGROUP BY time ORDER BY time ASC\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Rows Read total",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "bars",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 16
          },
          "id": 4,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [],
                "filters": [
                  {
                    "condition": "AND",
                    "filterType": "custom",
                    "key": "query",
                    "operator": "IS NOT NULL",
                    "type": "Nullable(String)"
                  }
                ],
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [],
                  "filters": [
                    {
                      "condition": "AND",
                      "filterType": "custom",
                      "key": "query",
                      "operator": "IS NOT NULL",
                      "type": "Nullable(String)"
                    }
                  ],
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, sum(result_rows)\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head' \nAND $__timeFilter_ms(timestamp) \nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nGROUP BY time ORDER BY time ASC\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Result Rows total",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "bars",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  }
                ]
              },
              "unit": "bytes"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 24
          },
          "id": 5,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [],
                "filters": [
                  {
                    "condition": "AND",
                    "filterType": "custom",
                    "key": "query",
                    "operator": "IS NOT NULL",
                    "type": "Nullable(String)"
                  }
                ],
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [],
                  "filters": [
                    {
                      "condition": "AND",
                      "filterType": "custom",
                      "key": "query",
                      "operator": "IS NOT NULL",
                      "type": "Nullable(String)"
                    }
                  ],
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, sum(bytes_read)\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head' \nAND $__timeFilter_ms(timestamp) \nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nGROUP BY time ORDER BY time ASC\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Bytes Read total",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "bars",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  }
                ]
              },
              "unit": "bytes"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 24
          },
          "id": 6,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [],
                "filters": [
                  {
                    "condition": "AND",
                    "filterType": "custom",
                    "key": "query",
                    "operator": "IS NOT NULL",
                    "type": "Nullable(String)"
                  }
                ],
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [],
                  "filters": [
                    {
                      "condition": "AND",
                      "filterType": "custom",
                      "key": "query",
                      "operator": "IS NOT NULL",
                      "type": "Nullable(String)"
                    }
                  ],
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, sum(result_bytes)\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head' \nAND $__timeFilter_ms(timestamp) \nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nGROUP BY time ORDER BY time ASC\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Result Bytes total",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "bars",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 32
          },
          "id": 8,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [],
                "filters": [
                  {
                    "condition": "AND",
                    "filterType": "custom",
                    "key": "query",
                    "operator": "IS NOT NULL",
                    "type": "Nullable(String)"
                  }
                ],
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [],
                  "filters": [
                    {
                      "condition": "AND",
                      "filterType": "custom",
                      "key": "query",
                      "operator": "IS NOT NULL",
                      "type": "Nullable(String)"
                    }
                  ],
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, sum(num_partitions)\nFROM hydro.logs \nWHERE component = 'query_executor'\nAND app = 'query-head' \nAND $__timeFilter_ms(timestamp) \nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nGROUP BY time ORDER BY time ASC\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Number of Partitions Total",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "bars",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  }
                ]
              },
              "unit": "bytes"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 32
          },
          "id": 7,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [],
                "filters": [
                  {
                    "condition": "AND",
                    "filterType": "custom",
                    "key": "query",
                    "operator": "IS NOT NULL",
                    "type": "Nullable(String)"
                  }
                ],
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [],
                  "filters": [
                    {
                      "condition": "AND",
                      "filterType": "custom",
                      "key": "query",
                      "operator": "IS NOT NULL",
                      "type": "Nullable(String)"
                    }
                  ],
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT $__timeInterval(timestamp) as time, sum(memory_usage_bytes)\nFROM hydro.logs \nWHERE component = 'query_executor'\nAND app = 'query-head' \nAND $__timeFilter_ms(timestamp) \nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nGROUP BY time ORDER BY time ASC\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A"
            }
          ],
          "title": "Memory Usage",
          "type": "timeseries"
        }
      ],
      "title": "Query Detailed Analysis",
      "type": "row"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 13,
      "panels": [
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${ DS_HYDROLIX_DATABASE}"
          },
          "gridPos": {
            "h": 22,
            "w": 24,
            "x": 0,
            "y": 9
          },
          "id": 11,
          "options": {
            "dedupStrategy": "none",
            "enableLogDetails": true,
            "prettifyLogMessage": true,
            "showCommonLabels": false,
            "showLabels": false,
            "showTime": true,
            "sortOrder": "Descending",
            "wrapLogMessage": false
          },
          "pluginVersion": "9.4.7",
          "targets": [
            {
              "builderOptions": {
                "database": "hydro",
                "fields": [
                  "query"
                ],
                "filters": [],
                "limit": 100,
                "metrics": [],
                "mode": "trend",
                "orderBy": [],
                "table": "logs",
                "timeField": "timestamp",
                "timeFieldType": "DateTime64(3)"
              },
              "datasource": {
                "type": "grafana-clickhouse-datasource",
                "uid": "${ DS_HYDROLIX_DATABASE}"
              },
              "format": 1,
              "meta": {
                "builderOptions": {
                  "database": "hydro",
                  "fields": [
                    "query"
                  ],
                  "filters": [],
                  "limit": 100,
                  "metrics": [],
                  "mode": "trend",
                  "orderBy": [],
                  "table": "logs",
                  "timeField": "timestamp",
                  "timeFieldType": "DateTime64(3)"
                }
              },
              "queryType": "sql",
              "rawSql": "SELECT timestamp, query as query, level, stack_trace, num_partitions, formatReadableSize(memory_usage_bytes) as memory_usage, formatReadableSize(bytes_read) as bytes_read, formatReadableSize(result_bytes) as result_bytes, pool, num_peers, query_attempts, index_stats, formatReadableQuantity(result_rows) as result_rows, formatReadableQuantity(rows_read) as rows_read, exec_time, exception\nFROM hydro.logs \nWHERE $__timeFilter_ms(timestamp) \nAND app = 'query-head' \nAND component = 'query_executor'\nAND $__conditionalAll(memory_usage_bytes >= $memory_usage_bytes, $memory_usage_percentile)\nAND $__conditionalAll($response_time, $response_time)\nAND $__conditionalAll(level IN ($query_status), $query_status)\nAND $__conditionalAll(num_partitions >= $num_partitions, $num_partitions_percentile)\nAND $__conditionalAll(hdx_query_admin_comment IN ($user), $user)\nAND if('$filter_hydro_logs' = 1, true, query NOT ILIKE '%hydro.logs%')\nAND if('$filter_system_logs' = 1, true, query NOT ILIKE '%from system.%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '% SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE '%SELECT  FROM  LIMIT 100%')\nAND if('$filter_system_logs' = 1, true, query NOT LIKE 'SELECT version()')\nAND if('${query_search:text}' = '', true, query LIKE '%${query_search}%')\nAND if('${error_search:text}' = '', true, stack_trace LIKE '%${error_search}%')\nAND NOT empty(query)\nORDER by timestamp ASC\nLIMIT 100\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
              "refId": "A",
              "selectedFormat": 4
            }
          ],
          "title": "Raw Query",
          "type": "logs"
        }
      ],
      "title": "Raw Logs",
      "type": "row"
    }
  ],
  "refresh": "",
  "revision": 1,
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": true,
          "text": "All",
          "value": "$__all"
        },
        "hide": 0,
        "includeAll": true,
        "multi": false,
        "name": "memory_usage_percentile",
        "options": [
          {
            "selected": true,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": false,
            "text": "0.5",
            "value": "0.5"
          },
          {
            "selected": false,
            "text": "0.75",
            "value": "0.75"
          },
          {
            "selected": false,
            "text": "0.90",
            "value": "0.90"
          },
          {
            "selected": false,
            "text": "0.95",
            "value": "0.95"
          }
        ],
        "query": "0.5 , 0.75 , 0.90 , 0.95",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": "All",
          "value": "$__all"
        },
        "hide": 0,
        "includeAll": true,
        "multi": false,
        "name": "num_partitions_percentile",
        "options": [
          {
            "selected": true,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": false,
            "text": "0.5",
            "value": "0.5"
          },
          {
            "selected": false,
            "text": "0.75",
            "value": "0.75"
          },
          {
            "selected": false,
            "text": "0.90",
            "value": "0.90"
          },
          {
            "selected": false,
            "text": "0.95",
            "value": "0.95"
          }
        ],
        "query": "0.5 , 0.75 , 0.90 , 0.95",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": "All",
          "value": "$__all"
        },
        "hide": 0,
        "includeAll": true,
        "multi": false,
        "name": "response_time",
        "options": [
          {
            "selected": true,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": false,
            "text": "<1s",
            "value": "exec_time < 1000"
          },
          {
            "selected": false,
            "text": "1s-2s",
            "value": "exec_time BETWEEN 1000 AND 2000"
          },
          {
            "selected": false,
            "text": "2s-5s",
            "value": "exec_time BETWEEN 2000  AND 5000"
          },
          {
            "selected": false,
            "text": "5s-10s",
            "value": "exec_time BETWEEN 5000  AND 10000"
          },
          {
            "selected": false,
            "text": "10s-20s",
            "value": "exec_time BETWEEN 10000  AND 20000"
          },
          {
            "selected": false,
            "text": "20s-30s",
            "value": "exec_time BETWEEN 20000  AND 30000"
          },
          {
            "selected": false,
            "text": "30s-1m",
            "value": "exec_time BETWEEN 30000  AND 60000"
          },
          {
            "selected": false,
            "text": "1min>",
            "value": "exec_time > 60000"
          }
        ],
        "query": "<1s : exec_time < 1000 , 1s-2s  : exec_time BETWEEN 1000 AND 2000 , 2s-5s : exec_time BETWEEN 2000  AND 5000 , 5s-10s : exec_time BETWEEN 5000  AND 10000 , 10s-20s : exec_time BETWEEN 10000  AND 20000 , 20s-30s : exec_time BETWEEN 20000  AND 30000 , 30s-1m : exec_time BETWEEN 30000  AND 60000 , 1min> : exec_time > 60000",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": [
            "All"
          ],
          "value": [
            "$__all"
          ]
        },
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "query_status",
        "options": [
          {
            "selected": true,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": false,
            "text": "success",
            "value": "info"
          },
          {
            "selected": false,
            "text": "error",
            "value": "error"
          }
        ],
        "query": "success : info , error",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${ DS_HYDROLIX_DATABASE}"
        },
        "definition": "SELECT hdx_query_admin_comment\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head'\nAND $__timeFilter_ms(timestamp)\nGROUP BY hdx_query_admin_comment\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "user",
        "options": [],
        "query": "SELECT hdx_query_admin_comment\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head'\nAND $__timeFilter_ms(timestamp)\nGROUP BY hdx_query_admin_comment\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${ DS_HYDROLIX_DATABASE}"
        },
        "definition": "SELECT arrayJoin(quantiles(${num_partitions_percentile})(num_partitions))\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head'\nAND $__timeFilter_ms(timestamp)\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
        "hide": 2,
        "includeAll": false,
        "label": "",
        "multi": false,
        "name": "num_partitions",
        "options": [],
        "query": "SELECT arrayJoin(quantiles(${num_partitions_percentile})(num_partitions))\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head'\nAND $__timeFilter_ms(timestamp)\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${ DS_HYDROLIX_DATABASE}"
        },
        "definition": "SELECT arrayJoin(quantiles(${memory_usage_percentile})(memory_usage_bytes))\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head'\nAND $__timeFilter_ms(timestamp)\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
        "hide": 2,
        "includeAll": false,
        "multi": false,
        "name": "memory_usage_bytes",
        "options": [],
        "query": "SELECT arrayJoin(quantiles(${memory_usage_percentile})(memory_usage_bytes))\nFROM hydro.logs\nWHERE component = 'query_executor'\nAND app = 'query-head'\nAND $__timeFilter_ms(timestamp)\nSETTINGS hdx_query_max_timerange_sec=604800, hdx_query_max_execution_time=60,hdx_query_admin_comment='${__user.login}'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "description": "Search for query pattern",
        "hide": 0,
        "name": "query_search",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "description": "Search for pattern in error message",
        "hide": 0,
        "name": "error_search",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${ DS_HYDROLIX_PROMETHEUS}"
        },
        "definition": "label_values(hdx_partition_blocks_read_total_count{service=\"query-head\"}, instance)",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "QueryHeads",
        "options": [],
        "query": {
          "query": "label_values(hdx_partition_blocks_read_total_count{service=\"query-head\"}, instance)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "/([^:]+):.*/",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${ DS_HYDROLIX_PROMETHEUS}"
        },
        "definition": "label_values(hdx_partition_blocks_read_total_count{service='query-peer'}, instance)",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "QueryPeer",
        "options": [],
        "query": {
          "query": "label_values(hdx_partition_blocks_read_total_count{service='query-peer'}, instance)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "/([^:]+):.*/",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": true,
          "text": "Exclude",
          "value": "0"
        },
        "description": "Filter Hydrolix Logs Queries.",
        "hide": 0,
        "includeAll": false,
        "label": "Hydro Logs",
        "multi": false,
        "name": "filter_hydro_logs",
        "options": [
          {
            "selected": false,
            "text": "Include",
            "value": "1"
          },
          {
            "selected": true,
            "text": "Exclude",
            "value": "0"
          }
        ],
        "query": "Include : 1, Exclude : 0",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": "Exclude",
          "value": "0"
        },
        "description": "Filter System Logs including Grafana and Clickhouse Driver Queries",
        "hide": 0,
        "includeAll": false,
        "label": "System Queries",
        "multi": false,
        "name": "filter_system_logs",
        "options": [
          {
            "selected": false,
            "text": "Include",
            "value": "1"
          },
          {
            "selected": true,
            "text": "Exclude",
            "value": "0"
          }
        ],
        "query": "Include : 1, Exclude : 0",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Hydrolix - Query Monitoring",
  "uid": "DE-RkO4Vza",
  "version": 16,
  "weekStart": ""
}