summaryrefslogtreecommitdiff
path: root/src/grafana/provisioning/dashboards/demo/postgresql-dashboard.json
diff options
context:
space:
mode:
authorSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
committerSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
commit82e03978b89938219958032efb1448cc76baa181 (patch)
tree626f3e54d52ecd49be0ed3bee30abacc0453d081 /src/grafana/provisioning/dashboards/demo/postgresql-dashboard.json
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'src/grafana/provisioning/dashboards/demo/postgresql-dashboard.json')
-rw-r--r--src/grafana/provisioning/dashboards/demo/postgresql-dashboard.json1474
1 files changed, 1474 insertions, 0 deletions
diff --git a/src/grafana/provisioning/dashboards/demo/postgresql-dashboard.json b/src/grafana/provisioning/dashboards/demo/postgresql-dashboard.json
new file mode 100644
index 0000000..2ac9432
--- /dev/null
+++ b/src/grafana/provisioning/dashboards/demo/postgresql-dashboard.json
@@ -0,0 +1,1474 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "datasource",
+ "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"
+ }
+ ]
+ },
+ "description": "Performance metrics for PostgreSQL instrumented with the OpenTelemetry Collector PostgreSQL receiver.",
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 0,
+ "id": 6,
+ "links": [
+ {
+ "asDropdown": false,
+ "includeVars": true,
+ "keepTime": true,
+ "tags": [
+ "postgres-integration"
+ ],
+ "title": "Integration dashboards",
+ "type": "dashboards"
+ }
+ ],
+ "panels": [
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 15,
+ "panels": [],
+ "title": "PostgreSQL Overview",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "description": "Queries per seconds. Queries being commits or rollbacks.\n",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "fixedColor": "rgb(31, 120, 193)",
+ "mode": "fixed"
+ },
+ "decimals": 0,
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 4,
+ "x": 0,
+ "y": 1
+ },
+ "id": 11,
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "mean"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.2",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "sum(irate(postgresql_commits_total{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",host_name=~\"$host_name\"}[$__rate_interval])) + sum(irate(postgresql_rollbacks_total{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",host_name=~\"$host_name\"}[$__rate_interval]))",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "xact_commit"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ "10s"
+ ],
+ "type": "non_negative_derivative"
+ }
+ ]
+ ],
+ "step": 1800,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ }
+ ],
+ "title": "QPS",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "description": "See [pg_stat_database / `tup_fetched`](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW)",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "never",
+ "spanNulls": true,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 20,
+ "x": 4,
+ "y": 1
+ },
+ "id": 1,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "table",
+ "placement": "right",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.2",
+ "targets": [
+ {
+ "alias": "fetched",
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "sum(irate(postgresql_tup_fetched_total{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",host_name=~\"$host_name\"}[$__rate_interval]))",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "legendFormat": "fetched",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "fetched",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tup_fetched"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ "10s"
+ ],
+ "type": "non_negative_derivative"
+ }
+ ]
+ ],
+ "step": 120,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ },
+ {
+ "alias": "fetched",
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "sum(irate(postgresql_tup_returned_total{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",host_name=~\"$host_name\"}[$__rate_interval]))",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "legendFormat": "returned",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "returned",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tup_fetched"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ "10s"
+ ],
+ "type": "non_negative_derivative"
+ }
+ ]
+ ],
+ "step": 120,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ },
+ {
+ "alias": "fetched",
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "sum(irate(postgresql_tup_inserted_total{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",host_name=~\"$host_name\"}[$__rate_interval]))",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "hide": false,
+ "intervalFactor": 2,
+ "legendFormat": "inserted",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "inserted",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tup_fetched"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ "10s"
+ ],
+ "type": "non_negative_derivative"
+ }
+ ]
+ ],
+ "step": 120,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ },
+ {
+ "alias": "fetched",
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "sum(irate(postgresql_tup_updated_total{dpostgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",host_name=~\"$host_name\"}[$__rate_interval]))",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "hide": false,
+ "intervalFactor": 2,
+ "legendFormat": "updated",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "updated",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tup_fetched"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ "10s"
+ ],
+ "type": "non_negative_derivative"
+ }
+ ]
+ ],
+ "step": 120,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ },
+ {
+ "alias": "fetched",
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "sum(irate(postgresql_tup_deleted_total{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",host_name=~\"$host_name\"}[$__rate_interval]))",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "hide": false,
+ "intervalFactor": 2,
+ "legendFormat": "deleted",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "deleted",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tup_fetched"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ "10s"
+ ],
+ "type": "non_negative_derivative"
+ }
+ ]
+ ],
+ "step": 120,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ }
+ ],
+ "title": "Rows",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "never",
+ "spanNulls": true,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 0,
+ "y": 8
+ },
+ "id": 2,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "table",
+ "placement": "right",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.2",
+ "targets": [
+ {
+ "alias": "Buffers Allocated",
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "irate(postgresql_bgwriter_buffers_allocated_total{host_name=~\"$host_name\", k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\"}[$__rate_interval])",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "legendFormat": "buffers allocated",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "buffers_allocated",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "buffers_alloc"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [],
+ "type": "difference"
+ }
+ ]
+ ],
+ "step": 240,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "$datasource"
+ },
+ "disableTextWrap": false,
+ "editorMode": "code",
+ "expr": "irate(postgresql_bgwriter_buffers_writes_total{k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\", host_name=~\"$host_name\"}[$__interval])",
+ "fullMetaSearch": false,
+ "hide": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "interval": "",
+ "legendFormat": "buffers write {{source}}",
+ "range": true,
+ "refId": "buffers_write",
+ "useBackend": false
+ },
+ {
+ "alias": "Buffers Allocated",
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "dsType": "prometheus",
+ "expr": "irate(pg_stat_bgwriter_buffers_backend_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "legendFormat": "buffers_backend",
+ "measurement": "postgresql",
+ "policy": "default",
+ "refId": "buffers_backend",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "buffers_alloc"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [],
+ "type": "difference"
+ }
+ ]
+ ],
+ "step": 240,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ },
+ {
+ "alias": "Buffers Allocated",
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "dsType": "prometheus",
+ "expr": "irate(pg_stat_bgwriter_buffers_clean_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "legendFormat": "buffers_clean",
+ "measurement": "postgresql",
+ "policy": "default",
+ "refId": "buffers_clean",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "buffers_alloc"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [],
+ "type": "difference"
+ }
+ ]
+ ],
+ "step": 240,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ },
+ {
+ "alias": "Buffers Allocated",
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "irate(postgresql_bgwriter_checkpoint_count_total{k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\", host_name=~\"$host_name\"}[$__rate_interval])",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "legendFormat": "checkpoint {{type}}",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "checkpoint",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "buffers_alloc"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [],
+ "type": "difference"
+ }
+ ]
+ ],
+ "step": 240,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ }
+ ],
+ "title": "Buffers",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "$datasource"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 2,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "never",
+ "spanNulls": true,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "deadlocks"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "light-red",
+ "mode": "fixed"
+ }
+ }
+ ]
+ },
+ {
+ "__systemRef": "hideSeriesFrom",
+ "matcher": {
+ "id": "byNames",
+ "options": {
+ "mode": "exclude",
+ "names": [
+ "deadlocks"
+ ],
+ "prefix": "All except:",
+ "readOnly": true
+ }
+ },
+ "properties": [
+ {
+ "id": "custom.hideFrom",
+ "value": {
+ "legend": false,
+ "tooltip": false,
+ "viz": true
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 12,
+ "y": 8
+ },
+ "id": 3,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.2",
+ "targets": [
+ {
+ "alias": "conflicts",
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "sum(postgresql_deadlocks_total{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\", host_name=~\"$host_name\"})",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "legendFormat": "deadlocks",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "deadlocks",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "conflicts"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [],
+ "type": "difference"
+ }
+ ]
+ ],
+ "step": 240,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ },
+ {
+ "alias": "deadlocks",
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "dsType": "prometheus",
+ "editorMode": "code",
+ "expr": "sum(postgresql_conflicts_total{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",host_name=~\"$host_name\"})",
+ "format": "time_series",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "intervalFactor": 2,
+ "legendFormat": "conflicts",
+ "measurement": "postgresql",
+ "policy": "default",
+ "range": true,
+ "refId": "conflicts-not-yet-implemented-in-otelcol",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "deadlocks"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [],
+ "type": "difference"
+ }
+ ]
+ ],
+ "step": 240,
+ "tags": [
+ {
+ "key": "instance",
+ "operator": "=~",
+ "value": "/^$instance$/"
+ }
+ ]
+ }
+ ],
+ "title": "Conflicts/Deadlocks",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 2,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "never",
+ "spanNulls": true,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "max": 100,
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "percent"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 0,
+ "y": 15
+ },
+ "id": 12,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.2",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "editorMode": "code",
+ "expr": "round(\n sum by (postgresql_database_name) (\n rate(\n postgresql_blks_hit_total{\n postgresql_database_name=~\"$db\",\n k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",\n host_name=~\"$host_name\"\n }[$__rate_interval]\n )\n )\n /\n (\n sum by (postgresql_database_name) (\n rate(\n postgresql_blks_hit_total{\n postgresql_database_name=~\"$db\",\n k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",\n host_name=~\"$host_name\"\n }[$__rate_interval]\n )\n )\n +\n sum by (postgresql_database_name) (\n rate(\n postgresql_blks_read_total{\n postgresql_database_name=~\"$db\",\n k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\",\n host_name=~\"$host_name\"\n }[$__rate_interval]\n )\n )\n ) * 100,\n 0.001\n)",
+ "format": "time_series",
+ "legendFormat": "{{postgresql_database_name}} - cache hit ratio",
+ "range": true,
+ "refId": "A",
+ "step": 240
+ }
+ ],
+ "title": "Cache hit ratio",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 2,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "never",
+ "spanNulls": true,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 12,
+ "y": 15
+ },
+ "id": 13,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.2",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "editorMode": "code",
+ "expr": "postgresql_backends{postgresql_database_name=~\"$db\",k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\", host_name=~\"$host_name\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "{{postgresql_database_name}} - connections",
+ "range": true,
+ "refId": "A",
+ "step": 240
+ }
+ ],
+ "title": "Number of active connections",
+ "type": "timeseries"
+ }
+ ],
+ "preload": false,
+ "refresh": "30s",
+ "schemaVersion": 41,
+ "tags": [
+ "opentelemetry",
+ "postgresql"
+ ],
+ "templating": {
+ "list": [
+ {
+ "current": {
+ "text": "Prometheus",
+ "value": "webstore-metrics"
+ },
+ "includeAll": false,
+ "label": "Data Source",
+ "name": "datasource",
+ "options": [],
+ "query": "prometheus",
+ "refresh": 1,
+ "regex": "(?!grafanacloud-usage|grafanacloud-ml-metrics).+",
+ "type": "datasource"
+ },
+ {
+ "allValue": ".*",
+ "current": {
+ "text": "All",
+ "value": "$__all"
+ },
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "definition": "label_values(postgresql_table_count,k8s_cluster_name)",
+ "description": "When deploying PostgreSQL on Kubernetes, name of the Kubernetes cluster. \nFor other deployments, select \"All\". ",
+ "includeAll": true,
+ "label": "K8s Cluster",
+ "multi": true,
+ "name": "k8s_cluster_name",
+ "options": [],
+ "query": {
+ "qryType": 1,
+ "query": "label_values(postgresql_table_count,k8s_cluster_name)",
+ "refId": "PrometheusVariableQueryEditor-VariableQuery"
+ },
+ "refresh": 2,
+ "regex": "",
+ "sort": 1,
+ "type": "query"
+ },
+ {
+ "allValue": ".*",
+ "current": {
+ "text": "",
+ "value": ""
+ },
+ "definition": "label_values(postgresql_table_count{k8s_cluster_name=~\"$k8s_cluster_name\"},k8s_statefulset_name)",
+ "description": "When deploying on Kubernetes, name of the `StatefulSet` of the PostgreSQL deployment (e.g. `my-pg-cluster`).\nFor other deployments, select \"All\". ",
+ "includeAll": true,
+ "label": "K8s Statefulset",
+ "multi": true,
+ "name": "k8s_statefulset_name",
+ "options": [],
+ "query": {
+ "qryType": 1,
+ "query": "label_values(postgresql_table_count{k8s_cluster_name=~\"$k8s_cluster_name\"},k8s_statefulset_name)",
+ "refId": "PrometheusVariableQueryEditor-VariableQuery"
+ },
+ "refresh": 1,
+ "regex": "",
+ "type": "query"
+ },
+ {
+ "allValue": ".+",
+ "current": {
+ "text": "All",
+ "value": [
+ "$__all"
+ ]
+ },
+ "datasource": {
+ "uid": "$datasource"
+ },
+ "definition": "label_values(postgresql_table_count{k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\"},host_name)",
+ "description": "When deploying PostgreSQL on VMs, name on the host on which the database is deployed.\nFor other deployments, select \"All\". ",
+ "includeAll": true,
+ "label": "Host",
+ "multi": true,
+ "name": "host_name",
+ "options": [],
+ "query": {
+ "qryType": 1,
+ "query": "label_values(postgresql_table_count{k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\"},host_name)",
+ "refId": "PrometheusVariableQueryEditor-VariableQuery"
+ },
+ "refresh": 2,
+ "regex": "",
+ "sort": 1,
+ "type": "query"
+ },
+ {
+ "allValue": ".+",
+ "current": {
+ "text": "All",
+ "value": "$__all"
+ },
+ "datasource": {
+ "type": "prometheus",
+ "uid": "webstore-metrics"
+ },
+ "definition": "label_values(postgresql_table_count{host_name=~\"$host_name\", postgresql_database_name!~\"template.*|postgres\", k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\"},postgresql_database_name)",
+ "includeAll": true,
+ "label": "Database",
+ "name": "db",
+ "options": [],
+ "query": {
+ "qryType": 1,
+ "query": "label_values(postgresql_table_count{host_name=~\"$host_name\", postgresql_database_name!~\"template.*|postgres\", k8s_cluster_name=~\"$k8s_cluster_name\", k8s_statefulset_name=~\"$k8s_statefulset_name\"},postgresql_database_name)",
+ "refId": "PrometheusVariableQueryEditor-VariableQuery"
+ },
+ "refresh": 2,
+ "regex": "",
+ "type": "query"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-30m",
+ "to": "now"
+ },
+ "timepicker": {},
+ "timezone": "browser",
+ "title": "PostgreSQL",
+ "uid": "xHhbQmdjA",
+ "version": 5
+} \ No newline at end of file