ssube/prometheus-sql-adapter

View on GitHub
grafana/meta/grafana.json

Summary

Maintainability
Test Coverage
{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 17,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "monitor-timescale",
      "fill": 1,
      "fillGradient": 2,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "grafana-0 - 0.5",
          "color": "#73BF69"
        },
        {
          "alias": "grafana-0 - 0.9",
          "color": "#FADE2A"
        },
        {
          "alias": "grafana-0 - 0.99",
          "color": "#FF9830"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  CONCAT(labels->>'pod', ' - ', labels->>'quantile') AS metric,\n  $__timeGroup(time, '${__interval}') AS time,\n  MAX(value) AS value\nFROM metrics\nWHERE $__timeFilter(time) AND name = 'grafana_alerting_execution_time_milliseconds'\nGROUP BY $__timeGroup(time, '${__interval}'), metric\nORDER BY $__timeGroup(time, '${__interval}'), metric",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "delta_usage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "agg_container_cpu",
          "timeColumn": "bucket",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Alert Execution",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "ms",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "monitor-timescale",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "id": 4,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  metric,\n  bucket AS time,\n  rate_time(value, lag(value) OVER w, '${__interval}') AS value\nFROM (\nSELECT\n  CONCAT(labels->>'pod', ' - ', labels->>'type') AS metric,\n  $__timeGroup(time, '${__interval}') AS bucket,\n  MAX(value) AS value\nFROM metrics\nWHERE $__timeFilter(time) AND name = 'grafana_alerting_notification_failed_total'\nGROUP BY metric, bucket\n) AS m\nWINDOW w AS (PARTITION BY metric ORDER BY bucket)\nORDER BY bucket, metric",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "delta_usage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "agg_container_cpu",
          "timeColumn": "bucket",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Alerts Sent",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "monitor-timescale",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 9
      },
      "id": 3,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "grafana-0 - alerting",
          "color": "#F2495C"
        },
        {
          "alias": "grafana-0 - no_data",
          "color": "#5794F2"
        },
        {
          "alias": "grafana-0 - ok",
          "color": "#73BF69"
        },
        {
          "alias": "grafana-0 - pending",
          "color": "#FADE2A"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  metric,\n  bucket AS time,\n  rate_time(value, lag(value) OVER w, '${__interval}') AS value\nFROM (\nSELECT\n  CONCAT(labels->>'pod', ' - ', labels->>'state') AS metric,\n  $__timeGroup(time, '${__interval}') AS bucket,\n  MAX(value) AS value\nFROM metrics\nWHERE $__timeFilter(time) AND name = 'grafana_alerting_result_total'\nGROUP BY metric, bucket\n) AS m\nWINDOW w AS (PARTITION BY metric ORDER BY bucket)\nORDER BY bucket, metric",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "delta_usage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "agg_container_cpu",
          "timeColumn": "bucket",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Alerts Firing",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "monitor-timescale",
      "fill": 1,
      "fillGradient": 2,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 9
      },
      "id": 5,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": true,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*- alerting/",
          "color": "#F2495C"
        },
        {
          "alias": "/.*- no_data/",
          "color": "#B877D9"
        },
        {
          "alias": "/.*- pending/",
          "color": "#FF9830"
        },
        {
          "alias": "/.*- ok/",
          "color": "#73BF69"
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  CONCAT(labels->>'pod', ' - ', labels->>'state') AS metric,\n  $__timeGroup(bucket, '${__interval}') AS time,\n  SUM(delta_value) AS value\nFROM agg_grafana_alert AS s \nJOIN metric_labels AS l \n  ON l.lid = s.lid\nWHERE $__timeFilter(bucket)\nGROUP BY $__timeGroup(bucket, '${__interval}'), metric\nORDER BY $__timeGroup(bucket, '${__interval}'), metric",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "delta_usage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "agg_container_cpu",
          "timeColumn": "bucket",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Alert Execution",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": "100",
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": false,
  "schemaVersion": 20,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Grafana",
  "uid": "OETJZVBWz",
  "version": 11
}