kind: ConfigMap
apiVersion: v1
metadata:
  name: grafana-dashboard-hub-thanos-query-frontend
  namespace: open-cluster-management-observability
  labels:
    grafana-custom-dashboard: "true"
data:
  hub-thanos-query-frontend.json: |-
   {
      "annotations": {
         "list": [ ]
      },
      "editable": true,
      "gnetId": null,
      "graphTooltip": 0,
      "hideControls": false,
      "links": [ ],
      "refresh": "10s",
      "rows": [
         {
            "collapse": false,
            "height": "250px",
            "panels": [
               {
                  "aliasColors": { },
                  "bars": false,
                  "dashLength": 10,
                  "dashes": false,
                  "datasource": "$datasource",
                  "description": "Shows rate of requests against Query Frontend for the given time.",
                  "fill": 10,
                  "id": 1,
                  "legend": {
                     "avg": false,
                     "current": false,
                     "max": false,
                     "min": false,
                     "show": true,
                     "total": false,
                     "values": false
                  },
                  "lines": true,
                  "linewidth": 0,
                  "links": [ ],
                  "nullPointMode": "null as zero",
                  "percentage": false,
                  "pointradius": 5,
                  "points": false,
                  "renderer": "flot",
                  "seriesOverrides": [
                     {
                        "alias": "/1../",
                        "color": "#EAB839"
                     },
                     {
                        "alias": "/2../",
                        "color": "#37872D"
                     },
                     {
                        "alias": "/3../",
                        "color": "#E0B400"
                     },
                     {
                        "alias": "/4../",
                        "color": "#1F60C4"
                     },
                     {
                        "alias": "/5../",
                        "color": "#C4162A"
                     }
                  ],
                  "spaceLength": 10,
                  "span": 3,
                  "stack": true,
                  "steppedLine": false,
                  "targets": [
                     {
                        "expr": "sum by (job, handler, code) (rate(acm_http_requests_total{cluster=\"$cluster\", job=~\"$job\", handler=\"query-frontend\"}[$__rate_interval]))",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "{{job}} {{handler}} {{code}}",
                        "step": 10
                     }
                  ],
                  "thresholds": [ ],
                  "timeFrom": null,
                  "timeShift": null,
                  "title": "Rate of requests",
                  "tooltip": {
                     "shared": false,
                     "sort": 0,
                     "value_type": "individual"
                  },
                  "type": "graph",
                  "xaxis": {
                     "buckets": null,
                     "mode": "time",
                     "name": null,
                     "show": true,
                     "values": [ ]
                  },
                  "yaxes": [
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": 0,
                        "show": true
                     },
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                     }
                  ]
               },
               {
                  "aliasColors": { },
                  "bars": false,
                  "dashLength": 10,
                  "dashes": false,
                  "datasource": "$datasource",
                  "description": "Shows rate of queries passing through Query Frontend",
                  "fill": 10,
                  "id": 2,
                  "legend": {
                     "avg": false,
                     "current": false,
                     "max": false,
                     "min": false,
                     "show": true,
                     "total": false,
                     "values": false
                  },
                  "lines": true,
                  "linewidth": 0,
                  "links": [ ],
                  "nullPointMode": "null as zero",
                  "percentage": false,
                  "pointradius": 5,
                  "points": false,
                  "renderer": "flot",
                  "seriesOverrides": [
                     {
                        "alias": "/1../",
                        "color": "#EAB839"
                     },
                     {
                        "alias": "/2../",
                        "color": "#37872D"
                     },
                     {
                        "alias": "/3../",
                        "color": "#E0B400"
                     },
                     {
                        "alias": "/4../",
                        "color": "#1F60C4"
                     },
                     {
                        "alias": "/5../",
                        "color": "#C4162A"
                     }
                  ],
                  "spaceLength": 10,
                  "span": 3,
                  "stack": true,
                  "steppedLine": false,
                  "targets": [
                     {
                        "expr": "sum by (job, handler, code) (rate(acm_thanos_query_frontend_queries_total{cluster=\"$cluster\", job=~\"$job\", op=\"query_range\"}[$__rate_interval]))",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "{{job}} {{handler}} {{code}}",
                        "step": 10
                     }
                  ],
                  "thresholds": [ ],
                  "timeFrom": null,
                  "timeShift": null,
                  "title": "Rate of queries",
                  "tooltip": {
                     "shared": false,
                     "sort": 0,
                     "value_type": "individual"
                  },
                  "type": "graph",
                  "xaxis": {
                     "buckets": null,
                     "mode": "time",
                     "name": null,
                     "show": true,
                     "values": [ ]
                  },
                  "yaxes": [
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": 0,
                        "show": true
                     },
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                     }
                  ]
               },
               {
                  "aliasColors": {
                     "error": "#E24D42"
                  },
                  "bars": false,
                  "dashLength": 10,
                  "dashes": false,
                  "datasource": "$datasource",
                  "description": "Shows ratio of errors compared to the the total number of handled requests against Query Frontend.",
                  "fill": 10,
                  "id": 3,
                  "legend": {
                     "avg": false,
                     "current": false,
                     "max": false,
                     "min": false,
                     "show": true,
                     "total": false,
                     "values": false
                  },
                  "lines": true,
                  "linewidth": 0,
                  "links": [ ],
                  "nullPointMode": "null as zero",
                  "percentage": false,
                  "pointradius": 5,
                  "points": false,
                  "renderer": "flot",
                  "seriesOverrides": [ ],
                  "spaceLength": 10,
                  "span": 3,
                  "stack": true,
                  "steppedLine": false,
                  "targets": [
                     {
                        "expr": "sum by (job) (rate(acm_http_requests_total{cluster=\"$cluster\", job=~\"$job\", handler=\"query-frontend\",code=~\"5..\"}[$__rate_interval])) / sum by (job) (rate(acm_http_requests_total{cluster=\"$cluster\", job=~\"$job\", handler=\"query-frontend\"}[$__rate_interval]))",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "error",
                        "step": 10
                     }
                  ],
                  "thresholds": [ ],
                  "timeFrom": null,
                  "timeShift": null,
                  "title": "Errors",
                  "tooltip": {
                     "shared": false,
                     "sort": 0,
                     "value_type": "individual"
                  },
                  "type": "graph",
                  "xaxis": {
                     "buckets": null,
                     "mode": "time",
                     "name": null,
                     "show": true,
                     "values": [ ]
                  },
                  "yaxes": [
                     {
                        "format": "percentunit",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": 0,
                        "show": true
                     },
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                     }
                  ]
               },
               {
                  "aliasColors": { },
                  "bars": false,
                  "dashLength": 10,
                  "dashes": false,
                  "datasource": "$datasource",
                  "description": "Shows how long has it taken to handle requests in quantiles.",
                  "fill": 1,
                  "id": 4,
                  "legend": {
                     "avg": false,
                     "current": false,
                     "max": false,
                     "min": false,
                     "show": true,
                     "total": false,
                     "values": false
                  },
                  "lines": true,
                  "linewidth": 1,
                  "links": [ ],
                  "nullPointMode": "null as zero",
                  "percentage": false,
                  "pointradius": 5,
                  "points": false,
                  "renderer": "flot",
                  "seriesOverrides": [
                     {
                        "alias": "p99",
                        "color": "#FA6400",
                        "fill": 1,
                        "fillGradient": 1
                     },
                     {
                        "alias": "p90",
                        "color": "#E0B400",
                        "fill": 1,
                        "fillGradient": 1
                     },
                     {
                        "alias": "p50",
                        "color": "#37872D",
                        "fill": 10,
                        "fillGradient": 0
                     }
                  ],
                  "spaceLength": 10,
                  "span": 3,
                  "stack": false,
                  "steppedLine": false,
                  "targets": [
                     {
                        "expr": "histogram_quantile(0.50, sum by (job, le) (rate(acm_http_request_duration_seconds_bucket{cluster=\"$cluster\", job=~\"$job\", handler=\"query-frontend\"}[$__rate_interval]))) * 1",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "p50 {{job}}",
                        "logBase": 10,
                        "max": null,
                        "min": null,
                        "step": 10
                     },
                     {
                        "expr": "histogram_quantile(0.90, sum by (job, le) (rate(acm_http_request_duration_seconds_bucket{cluster=\"$cluster\", job=~\"$job\", handler=\"query-frontend\"}[$__rate_interval]))) * 1",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "p90 {{job}}",
                        "logBase": 10,
                        "max": null,
                        "min": null,
                        "step": 10
                     },
                     {
                        "expr": "histogram_quantile(0.99, sum by (job, le) (rate(acm_http_request_duration_seconds_bucket{cluster=\"$cluster\", job=~\"$job\", handler=\"query-frontend\"}[$__rate_interval]))) * 1",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "p99 {{job}}",
                        "logBase": 10,
                        "max": null,
                        "min": null,
                        "step": 10
                     }
                  ],
                  "thresholds": [ ],
                  "timeFrom": null,
                  "timeShift": null,
                  "title": "Duration",
                  "tooltip": {
                     "shared": false,
                     "sort": 0,
                     "value_type": "individual"
                  },
                  "type": "graph",
                  "xaxis": {
                     "buckets": null,
                     "mode": "time",
                     "name": null,
                     "show": true,
                     "values": [ ]
                  },
                  "yaxes": [
                     {
                        "format": "s",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": 0,
                        "show": true
                     },
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                     }
                  ]
               }
            ],
            "repeat": null,
            "repeatIteration": null,
            "repeatRowId": null,
            "showTitle": true,
            "title": "Query Frontend API",
            "titleSize": "h6"
         },
         {
            "collapse": false,
            "height": "250px",
            "panels": [
               {
                  "aliasColors": { },
                  "bars": false,
                  "dashLength": 10,
                  "dashes": false,
                  "datasource": "$datasource",
                  "description": "Show rate of cache requests.",
                  "fill": 10,
                  "id": 5,
                  "legend": {
                     "avg": false,
                     "current": false,
                     "max": false,
                     "min": false,
                     "show": true,
                     "total": false,
                     "values": false
                  },
                  "lines": true,
                  "linewidth": 0,
                  "links": [ ],
                  "nullPointMode": "null as zero",
                  "percentage": false,
                  "pointradius": 5,
                  "points": false,
                  "renderer": "flot",
                  "seriesOverrides": [ ],
                  "spaceLength": 10,
                  "span": 3,
                  "stack": true,
                  "steppedLine": false,
                  "targets": [
                     {
                        "expr": "sum by (job, tripperware) (rate(acm_cortex_cache_request_duration_seconds_count{cluster=\"$cluster\", job=~\"$job\"}[$__rate_interval]))",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "{{job}} {{tripperware}}",
                        "legendLink": null,
                        "step": 10
                     }
                  ],
                  "thresholds": [ ],
                  "timeFrom": null,
                  "timeShift": null,
                  "title": "Requests",
                  "tooltip": {
                     "shared": false,
                     "sort": 0,
                     "value_type": "individual"
                  },
                  "type": "graph",
                  "xaxis": {
                     "buckets": null,
                     "mode": "time",
                     "name": null,
                     "show": true,
                     "values": [ ]
                  },
                  "yaxes": [
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": 0,
                        "show": true
                     },
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                     }
                  ]
               },
               {
                  "aliasColors": { },
                  "bars": false,
                  "dashLength": 10,
                  "dashes": false,
                  "datasource": "$datasource",
                  "description": "Show rate of Querier cache gets vs misses.",
                  "fill": 10,
                  "id": 6,
                  "legend": {
                     "avg": false,
                     "current": false,
                     "max": false,
                     "min": false,
                     "show": true,
                     "total": false,
                     "values": false
                  },
                  "lines": true,
                  "linewidth": 0,
                  "links": [ ],
                  "nullPointMode": "null as zero",
                  "percentage": false,
                  "pointradius": 5,
                  "points": false,
                  "renderer": "flot",
                  "seriesOverrides": [ ],
                  "spaceLength": 10,
                  "span": 3,
                  "stack": true,
                  "steppedLine": false,
                  "targets": [
                     {
                        "expr": "sum by (job, tripperware) (rate(acm_querier_cache_gets_total{cluster=\"$cluster\", job=~\"$job\"}[$__rate_interval]))",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "Cache gets - {{job}} {{tripperware}}",
                        "legendLink": null,
                        "step": 10
                     },
                     {
                        "expr": "sum by (job, tripperware) (rate(acm_querier_cache_misses_total{cluster=\"$cluster\", job=~\"$job\"}[$__rate_interval]))",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "Cache misses - {{job}} {{tripperware}}",
                        "legendLink": null,
                        "step": 10
                     }
                  ],
                  "thresholds": [ ],
                  "timeFrom": null,
                  "timeShift": null,
                  "title": "Querier cache gets vs misses",
                  "tooltip": {
                     "shared": false,
                     "sort": 0,
                     "value_type": "individual"
                  },
                  "type": "graph",
                  "xaxis": {
                     "buckets": null,
                     "mode": "time",
                     "name": null,
                     "show": true,
                     "values": [ ]
                  },
                  "yaxes": [
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": 0,
                        "show": true
                     },
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                     }
                  ]
               },
               {
                  "aliasColors": { },
                  "bars": false,
                  "dashLength": 10,
                  "dashes": false,
                  "datasource": "$datasource",
                  "description": "Shows rate of cortex fetched keys.",
                  "fill": 10,
                  "id": 7,
                  "legend": {
                     "avg": false,
                     "current": false,
                     "max": false,
                     "min": false,
                     "show": true,
                     "total": false,
                     "values": false
                  },
                  "lines": true,
                  "linewidth": 0,
                  "links": [ ],
                  "nullPointMode": "null as zero",
                  "percentage": false,
                  "pointradius": 5,
                  "points": false,
                  "renderer": "flot",
                  "seriesOverrides": [ ],
                  "spaceLength": 10,
                  "span": 3,
                  "stack": true,
                  "steppedLine": false,
                  "targets": [
                     {
                        "expr": "sum by (job, tripperware) (rate(acm_cortex_cache_fetched_keys{cluster=\"$cluster\", job=~\"$job\"}[$__rate_interval]))",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "{{job}} {{tripperware}}",
                        "legendLink": null,
                        "step": 10
                     }
                  ],
                  "thresholds": [ ],
                  "timeFrom": null,
                  "timeShift": null,
                  "title": "Cortex fetched keys",
                  "tooltip": {
                     "shared": false,
                     "sort": 0,
                     "value_type": "individual"
                  },
                  "type": "graph",
                  "xaxis": {
                     "buckets": null,
                     "mode": "time",
                     "name": null,
                     "show": true,
                     "values": [ ]
                  },
                  "yaxes": [
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": 0,
                        "show": true
                     },
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                     }
                  ]
               },
               {
                  "aliasColors": { },
                  "bars": false,
                  "dashLength": 10,
                  "dashes": false,
                  "datasource": "$datasource",
                  "description": "Shows rate of cortex cache hits.",
                  "fill": 10,
                  "id": 8,
                  "legend": {
                     "avg": false,
                     "current": false,
                     "max": false,
                     "min": false,
                     "show": true,
                     "total": false,
                     "values": false
                  },
                  "lines": true,
                  "linewidth": 0,
                  "links": [ ],
                  "nullPointMode": "null as zero",
                  "percentage": false,
                  "pointradius": 5,
                  "points": false,
                  "renderer": "flot",
                  "seriesOverrides": [ ],
                  "spaceLength": 10,
                  "span": 3,
                  "stack": true,
                  "steppedLine": false,
                  "targets": [
                     {
                        "expr": "sum by (job, tripperware) (rate(acm_cortex_cache_hits{cluster=\"$cluster\", job=~\"$job\"}[$__rate_interval]))",
                        "format": "time_series",
                        "intervalFactor": 2,
                        "legendFormat": "{{job}} {{tripperware}}",
                        "legendLink": null,
                        "step": 10
                     }
                  ],
                  "thresholds": [ ],
                  "timeFrom": null,
                  "timeShift": null,
                  "title": "Cortex cache hits",
                  "tooltip": {
                     "shared": false,
                     "sort": 0,
                     "value_type": "individual"
                  },
                  "type": "graph",
                  "xaxis": {
                     "buckets": null,
                     "mode": "time",
                     "name": null,
                     "show": true,
                     "values": [ ]
                  },
                  "yaxes": [
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": 0,
                        "show": true
                     },
                     {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                     }
                  ]
               }
            ],
            "repeat": null,
            "repeatIteration": null,
            "repeatRowId": null,
            "showTitle": true,
            "title": "Cache Operations",
            "titleSize": "h6"
         }
      ],
      "schemaVersion": 14,
      "style": "dark",
      "tags": [
         "thanos-mixin"
      ],
      "templating": {
         "list": [
            {
               "current": {
                  "text": "default",
                  "value": "default"
               },
               "hide": 0,
               "label": null,
               "name": "datasource",
               "options": [ ],
               "query": "prometheus",
               "refresh": 1,
               "regex": "",
               "type": "datasource"
            },
            {
               "current": {
                 "selected": true,
                 "text": "",
                 "value": ""
               },
               "datasource": "$datasource",
               "label": "Cluster",
               "name": "cluster",
               "options": [],
               "query": {
                 "query": "label_values(cluster)",
                 "refId": "Observatorium-cluster-Variable-Query"
               },
               "refresh": 1,
               "regex": "",
               "type": "query"
            },
            {
               "allValue": null,
               "current": {
                  "text": "all",
                  "value": "$__all"
               },
               "datasource": "$datasource",
               "hide": 0,
               "includeAll": true,
               "label": "job",
               "multi": false,
               "name": "job",
               "options": [ ],
               "query": "label_values(up{job=~\".*thanos-query-frontend.*\"}, job)",
               "refresh": 1,
               "regex": "",
               "sort": 2,
               "tagValuesQuery": "",
               "tags": [ ],
               "tagsQuery": "",
               "type": "query",
               "useTags": false
            }
         ]
      },
      "time": {
         "from": "now-1h",
         "to": "now"
      },
      "timepicker": {
         "refresh_intervals": [
            "5s",
            "10s",
            "30s",
            "1m",
            "5m",
            "15m",
            "30m",
            "1h",
            "2h",
            "1d"
         ],
         "time_options": [
            "5m",
            "15m",
            "1h",
            "6h",
            "12h",
            "24h",
            "2d",
            "7d",
            "30d"
         ]
      },
      "timezone": "UTC",
      "title": "Thanos / Query Frontend",
      "uid": "7c68ed2ef2355474f058dd27f0471f7a",
      "version": 0
   }
