{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "datasource", "uid": "grafana" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "links": [], "panels": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "pgwatch-metrics" }, "description": "As per \"settings\" metric.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "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": "server_version_num" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "custom.cellOptions", "value": { "type": "color-background" } }, { "id": "custom.align", "value": "left" }, { "id": "thresholds", "value": { "mode": "absolute", "steps": [ { "color": "rgba(245, 54, 54, 0.9)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 90400 }, { "color": "rgba(50, 172, 45, 0.97)", "value": 90600 } ] } } ] } ] }, "gridPos": { "h": 14, "w": 24, "x": 0, "y": 0 }, "id": 2, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true }, "pluginVersion": "10.4.1", "targets": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "pgwatch-metrics" }, "format": "table", "group": [], "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "measurement": "sproc_stats", "metricColumn": "none", "orderByTime": "ASC", "policy": "default", "query": "SELECT top(\"spread\", \"function_full_name\", \"oid\", $top) FROM (SELECT spread(\"total_time\") FROM \"sproc_stats\" WHERE $timeFilter AND \"dbname\" = '$dbname' GROUP BY time(3650d), \"function_full_name\", \"oid\" fill(none) ) WHERE spread > 0", "rawQuery": true, "rawSql": "SELECT\n split_part(data->>'server_version'::text, ' ', 1) as server_version,\n (data->'server_version_num')::int8 as server_version_num,\n string_agg(DISTINCT dbname, ', ') as dbname \nFROM\n settings\nWHERE\n $__timeFilter(time)\n AND dbname IN ($dbname)\n AND (data->>'server_version_num')::int8 <= $lower_than_server_version_num\nGROUP BY 1, 2\nORDER BY 1", "refId": "A", "resultFormat": "table", "select": [ [ { "params": [ "total_time" ], "type": "field" }, { "params": [], "type": "mean" } ] ], "tags": [], "timeColumn": "time", "where": [ { "name": "$__timeFilter", "params": [], "type": "macro" } ] } ], "title": "Monitored DBs by version", "transformations": [ { "id": "merge", "options": { "reducers": [] } } ], "type": "table" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "pgwatch-metrics" }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 14 }, "id": 8, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "

Brought to you by

\"Cybertec
", "mode": "html" }, "pluginVersion": "10.4.1", "targets": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "pgwatch-metrics" }, "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": false, "refId": "A", "select": [ [ { "params": [ "value" ], "type": "column" } ] ], "timeColumn": "time", "where": [ { "name": "$__timeFilter", "params": [], "type": "macro" } ] } ], "transparent": true, "type": "text" } ], "schemaVersion": 39, "tags": [ "pgwatch" ], "templating": { "list": [ { "current": { "selected": true, "text": [ "All" ], "value": [ "$__all" ] }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "pgwatch-metrics" }, "definition": "SELECT DISTINCT dbname FROM admin.all_distinct_dbname_metrics WHERE metric = 'settings' ORDER BY 1;", "hide": 0, "includeAll": true, "multi": true, "name": "dbname", "options": [], "query": "SELECT DISTINCT dbname FROM admin.all_distinct_dbname_metrics WHERE metric = 'settings' ORDER BY 1;", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", "tagsQuery": "", "type": "query", "useTags": false }, { "current": { "selected": false, "text": "160002", "value": "160002" }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "pgwatch-metrics" }, "definition": "SELECT DISTINCT (data->'server_version_num')::int FROM settings WHERE time > now() - '24h'::interval ORDER BY 1 DESC", "hide": 0, "includeAll": false, "multi": false, "name": "lower_than_server_version_num", "options": [], "query": "SELECT DISTINCT (data->'server_version_num')::int FROM settings WHERE time > now() - '24h'::interval ORDER BY 1 DESC", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", "tagsQuery": "", "type": "query", "useTags": false } ] }, "time": { "from": "now-6h", "to": "now" }, "timepicker": { "refresh_intervals": [ "5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ], "time_options": [ "5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d" ] }, "timezone": "", "title": "Postgres Version Overview", "uid": "postgres-version-overview", "version": 1, "weekStart": "" }