Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- title: 'PostgreSQL Overview',
- slug: 'postgresql-overview',
- tags: ['postgresql'],
- level: 'node',
- supportedClusterTypes: ['postgresql_single', 'postgresql'],
- supportNodeTypes: ['postgresql'],
- slots: [
- {
- title: 'SELECT (fetched)',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `pg_stat_database_tup_fetched{datname=~"$datname", instance=~"$instance"} != 0`,
- //legendFormat: '{{instance}} {{datname}}'
- legendFormat: 'Rows',
- type: 'line',
- }
- ]
- },
- {
- title: 'INSERT',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `pg_stat_database_tup_inserted{datname=~"$datname", instance=~"$instance"} != 0`,
- legendFormat: 'Rows',
- type: 'line',
- }
- ]
- },
- {
- title: 'UPDATE',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `pg_stat_database_tup_updated{datname=~"$datname", instance=~"$instance"} != 0`,
- legendFormat: 'Rows',
- type: 'line'
- }
- ]
- },
- {
- title: 'DELETE',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `pg_stat_database_tup_deleted{datname=~"$datname", instance=~"$instance"} != 0`,
- legendFormat: 'Rows',
- type: 'line'
- }
- ]
- },
- {
- title: 'SELECT (returned)',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `pg_stat_database_tup_returned{datname=~"$datname", instance=~"$instance"} != 0`,
- legendFormat: 'Rows',
- type: 'line'
- }
- ]
- },
- {
- title: 'Active Sessions',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `pg_stat_activity_count{datname=~"$datname", instance=~"$instance", state="active"} !=0`,
- legendFormat: 'Sessions',
- type: 'line'
- }
- ]
- },
- {
- title: 'Idle Sessions',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `pg_stat_activity_count{datname=~"$datname", instance=~"$instance", state=~"idle|idle in transaction|idle in transaction (aborted)"} !=0`,
- legendFormat: 'Sessions',
- type: 'line'
- }
- ]
- },
- {
- title: 'Lock Tables',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `pg_locks_count{datname=~"$datname", instance=~"$instance", mode=~"$mode"} != 0`,
- legendFormat: 'Locks',
- type: 'line'
- }
- ]
- },
- {
- title: 'Disk IO Utilization',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `rate(node_disk_io_time_ms{device=~"$device", instance="$host"}[$interval])/1000 or irate(node_disk_io_time_ms{device=~"$device", instance="$host"}[5m])/1000`,
- // disk/device name
- legendFormat: '{{ device }}',
- type: 'line'
- }
- ]
- },
- {
- title: 'Disk Usage',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `1 - node_filesystem_free{instance=~"$host", fstype!~"rootfs|selinuxfs|autofs|rpc_pipefs|tmpfs"} / node_filesystem_size{fstype!~"rootfs|selinuxfs|autofs|rpc_pipefs|tmpfs"}`,
- // disk/device name
- legendFormat: '{{ instance }}, {{ mountpoint }}',
- type: 'line'
- }
- ]
- },
- {
- title: 'Disk Latency',
- type: 'chart',
- monitorType: 'custom/postgresql',
- options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
- targets: [
- {
- expr: `(rate(node_disk_read_time_ms{device=~"$device", instance="$host"}[$interval]) / rate(node_disk_reads_completed{device=~"$device", instance="$host"}[$interval])) or (irate(node_disk_read_time_ms{device=~"$device", instance="$host"}[5m]) / irate(node_disk_reads_completed{device=~"$device", instance="$host"}[5m]))`,
- legendFormat: 'Read: {{ device }}',
- type: 'line'
- },
- {
- expr: `(rate(node_disk_write_time_ms{device=~"$device", instance="$host"}[$interval]) / rate(node_disk_writes_completed{device=~"$device", instance="$host"}[$interval])) or (irate(node_disk_write_time_ms{device=~"$device", instance="$host"}[5m]) / irate(node_disk_writes_completed{device=~"$device", instance="$host"}[5m]))`,
- // disk/device name
- legendFormat: 'Write: {{ device }}',
- type: 'line'
- }
- ]
- }
- ]
- }
Add Comment
Please, Sign In to add comment