Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the PostgreSQL Prometheus documentation and dashboard #581

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_total{${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_total{${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_total{${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_total{${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_total{${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_total{${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_total{${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_total{${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_total{${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_total{${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_total{${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_total{${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_total{${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.13.1
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.13.1
+ 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.13.1
default_metrics:
- name: prometheus.googleapis.com/pg_stat_database_numbackends/gauge
prometheus_name: pg_stat_database_numbackends
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the list of metrics below need to be updated as well

Expand Down