Skip to content

Commit

Permalink
Updated the PostgreSQL Prometheus documentation and dashboard (#581)
Browse files Browse the repository at this point in the history
* updated postgresql dashboard json to account for changes in the exporter

* updated docs and metadata to account for changes in the exporter

* fixed postgres dashboard displayName

* updated minimum supported version to 0.14.0

* revert change to update metric names

* reverted change to minimum supported version
  • Loading branch information
algchoo authored Sep 21, 2023
1 parent 1eaaab4 commit 6161f53
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 25 deletions.
102 changes: 81 additions & 21 deletions dashboards/postgresql/postgresql-prometheus.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,32 @@
},
"dataSets": [
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_tup_returned{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_database_tup_fetched{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
},
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_tup_returned{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_database_tup_returned{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
}
],
"thresholds": [],
"timeshiftDuration": "0s",
"yAxis": {
"label": "",
"scale": "LINEAR"
}
}
Expand All @@ -66,22 +76,21 @@
},
"dataSets": [
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_tup_returned{${Cluster},${Location},${Namespace}}"
}
},
{
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_tup_returned{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_database_temp_bytes{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
}
],
"thresholds": [],
"timeshiftDuration": "0s",
"yAxis": {
"label": "",
"scale": "LINEAR"
}
}
Expand All @@ -100,29 +109,43 @@
},
"dataSets": [
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_tup_deleted{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_database_tup_inserted{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
},
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_tup_updated{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_database_tup_updated{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
},
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_tup_deleted{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_database_tup_deleted{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
}
],
"thresholds": [],
"timeshiftDuration": "0s",
"yAxis": {
"label": "",
"scale": "LINEAR"
}
}
Expand All @@ -141,22 +164,32 @@
},
"dataSets": [
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_bgwriter_checkpoints_req_total{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_bgwriter_checkpoints_req{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
},
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_bgwriter_checkpoints_timed_total{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_bgwriter_checkpoints_timed{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
}
],
"thresholds": [],
"timeshiftDuration": "0s",
"yAxis": {
"label": "",
"scale": "LINEAR"
}
}
Expand All @@ -175,29 +208,43 @@
},
"dataSets": [
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_bgwriter_buffers_checkpoint_total{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_bgwriter_buffers_checkpoint{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
},
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_bgwriter_buffers_clean_total{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_bgwriter_buffers_clean{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
},
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_bgwriter_buffers_backend_total{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_bgwriter_buffers_backend{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
}
],
"thresholds": [],
"timeshiftDuration": "0s",
"yAxis": {
"label": "",
"scale": "LINEAR"
}
}
Expand All @@ -211,10 +258,13 @@
"widget": {
"scorecard": {
"gaugeView": {
"lowerBound": 0,
"upperBound": 1
},
"thresholds": [],
"timeSeriesQuery": {
"prometheusQuery": "sum(pg_stat_database_numbackends{${Cluster},${Location},${Namespace}}) / sum(pg_settings_max_connections{${Cluster},${Location},${Namespace}})"
"prometheusQuery": "sum(pg_stat_database_numbackends{${Cluster},${Location},${Namespace}}) / sum(pg_settings_max_connections{${Cluster},${Location},${Namespace}})",
"unitOverride": ""
}
},
"title": "Backend Utilization %"
Expand All @@ -233,22 +283,32 @@
},
"dataSets": [
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_blks_hit{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_database_blks_hit{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
},
{
"breakdowns": [],
"dimensions": [],
"measures": [],
"plotType": "LINE",
"targetAxis": "Y1",
"timeSeriesQuery": {
"prometheusQuery": "pg_stat_database_blks_read{${Cluster},${Location},${Namespace}}"
"prometheusQuery": "pg_stat_database_blks_read{${Cluster},${Location},${Namespace}}",
"unitOverride": ""
}
}
],
"thresholds": [],
"timeshiftDuration": "0s",
"yAxis": {
"label": "",
"scale": "LINEAR"
}
}
Expand Down
8 changes: 5 additions & 3 deletions integrations/postgresql/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exporter_name: the PostgreSQL exporter
exporter_pkg_name: postgres_exporter
exporter_repo_url: https://github.com/prometheus-community/postgres_exporter
dashboard_available: true
minimum_exporter_version: v0.11.1
minimum_exporter_version: v0.11.0
multiple_dashboards: false
dashboard_display_name: {{app_name_short}} Prometheus Overview
config_mods: |
Expand All @@ -26,7 +26,7 @@ config_mods: |
+ app.kubernetes.io/name: postgresql
spec:
containers:
- image: postgres:14.0
- image: postgres:15.3
name: postgresql
env:
- name: POSTGRES_USER
Expand All @@ -36,7 +36,9 @@ config_mods: |
- name: POSTGRES_DB
value: dev
+ - name: exporter
+ image: quay.io/prometheuscommunity/postgres-exporter:v0.11.1
+ image: quay.io/prometheuscommunity/postgres-exporter:v0.14.0
+ args:
+ - --collector.stat_statements
+ env:
+ - name: DATA_SOURCE_NAME
+ value: postgresql://root:password@localhost:5432/dev?sslmode=disable
Expand Down
2 changes: 1 addition & 1 deletion integrations/postgresql/prometheus_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ platforms:
exporter_metadata:
name: GKE Prometheus Exporter
doc_url: https://github.com/prometheus-community/postgres_exporter
minimum_supported_version: v0.11.1
minimum_supported_version: v0.11.0
default_metrics:
- name: prometheus.googleapis.com/pg_stat_database_numbackends/gauge
prometheus_name: pg_stat_database_numbackends
Expand Down

0 comments on commit 6161f53

Please sign in to comment.