Guest User

Untitled

a guest
Jul 11th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.39 KB | None | 0 0
  1. {
  2. title: 'PostgreSQL Overview',
  3. slug: 'postgresql-overview',
  4. tags: ['postgresql'],
  5. level: 'node',
  6. supportedClusterTypes: ['postgresql_single', 'postgresql'],
  7. supportNodeTypes: ['postgresql'],
  8. slots: [
  9. {
  10. title: 'SELECT (fetched)',
  11. type: 'chart',
  12. monitorType: 'custom/postgresql',
  13. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  14. targets: [
  15. {
  16. expr: `pg_stat_database_tup_fetched{datname=~"$datname", instance=~"$instance"} != 0`,
  17. //legendFormat: '{{instance}} {{datname}}'
  18. legendFormat: 'Rows',
  19. type: 'line',
  20. }
  21. ]
  22. },
  23. {
  24. title: 'INSERT',
  25. type: 'chart',
  26. monitorType: 'custom/postgresql',
  27. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  28. targets: [
  29. {
  30. expr: `pg_stat_database_tup_inserted{datname=~"$datname", instance=~"$instance"} != 0`,
  31. legendFormat: 'Rows',
  32. type: 'line',
  33. }
  34. ]
  35. },
  36. {
  37. title: 'UPDATE',
  38. type: 'chart',
  39. monitorType: 'custom/postgresql',
  40. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  41. targets: [
  42. {
  43. expr: `pg_stat_database_tup_updated{datname=~"$datname", instance=~"$instance"} != 0`,
  44. legendFormat: 'Rows',
  45. type: 'line'
  46. }
  47. ]
  48. },
  49. {
  50. title: 'DELETE',
  51. type: 'chart',
  52. monitorType: 'custom/postgresql',
  53. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  54. targets: [
  55. {
  56. expr: `pg_stat_database_tup_deleted{datname=~"$datname", instance=~"$instance"} != 0`,
  57. legendFormat: 'Rows',
  58. type: 'line'
  59. }
  60. ]
  61. },
  62. {
  63. title: 'SELECT (returned)',
  64. type: 'chart',
  65. monitorType: 'custom/postgresql',
  66. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  67. targets: [
  68. {
  69. expr: `pg_stat_database_tup_returned{datname=~"$datname", instance=~"$instance"} != 0`,
  70. legendFormat: 'Rows',
  71. type: 'line'
  72. }
  73. ]
  74. },
  75. {
  76. title: 'Active Sessions',
  77. type: 'chart',
  78. monitorType: 'custom/postgresql',
  79. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  80. targets: [
  81. {
  82. expr: `pg_stat_activity_count{datname=~"$datname", instance=~"$instance", state="active"} !=0`,
  83. legendFormat: 'Sessions',
  84. type: 'line'
  85. }
  86. ]
  87. },
  88. {
  89. title: 'Idle Sessions',
  90. type: 'chart',
  91. monitorType: 'custom/postgresql',
  92. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  93. targets: [
  94. {
  95. expr: `pg_stat_activity_count{datname=~"$datname", instance=~"$instance", state=~"idle|idle in transaction|idle in transaction (aborted)"} !=0`,
  96. legendFormat: 'Sessions',
  97. type: 'line'
  98. }
  99. ]
  100. },
  101. {
  102. title: 'Lock Tables',
  103. type: 'chart',
  104. monitorType: 'custom/postgresql',
  105. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  106. targets: [
  107. {
  108. expr: `pg_locks_count{datname=~"$datname", instance=~"$instance", mode=~"$mode"} != 0`,
  109. legendFormat: 'Locks',
  110. type: 'line'
  111. }
  112. ]
  113. },
  114. {
  115. title: 'Disk IO Utilization',
  116. type: 'chart',
  117. monitorType: 'custom/postgresql',
  118. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  119. targets: [
  120. {
  121. 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`,
  122. // disk/device name
  123. legendFormat: '{{ device }}',
  124. type: 'line'
  125. }
  126. ]
  127. },
  128. {
  129. title: 'Disk Usage',
  130. type: 'chart',
  131. monitorType: 'custom/postgresql',
  132. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  133. targets: [
  134. {
  135. expr: `1 - node_filesystem_free{instance=~"$host", fstype!~"rootfs|selinuxfs|autofs|rpc_pipefs|tmpfs"} / node_filesystem_size{fstype!~"rootfs|selinuxfs|autofs|rpc_pipefs|tmpfs"}`,
  136. // disk/device name
  137. legendFormat: '{{ instance }}, {{ mountpoint }}',
  138. type: 'line'
  139. }
  140. ]
  141. },
  142. {
  143. title: 'Disk Latency',
  144. type: 'chart',
  145. monitorType: 'custom/postgresql',
  146. options: { type: 'area', decimals: 0, legend: {alignAsTable: true}},
  147. targets: [
  148. {
  149. 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]))`,
  150. legendFormat: 'Read: {{ device }}',
  151. type: 'line'
  152. },
  153. {
  154. 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]))`,
  155. // disk/device name
  156. legendFormat: 'Write: {{ device }}',
  157. type: 'line'
  158. }
  159. ]
  160. }
  161. ]
  162. }
Add Comment
Please, Sign In to add comment