Grafana dashboard: OpenNMS - PostgreSQL Database Stats
Description: PostgreSQL database stats

The dashboard is maintained [on Github](https://github.com/opennms-forge/grafana-dashboards)

This dashboard requires the [PostgreSQL config module](https://github.com/opennms-config-modules/postgresql)

{
  "__inputs": [],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.3.4"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "datasource",
      "id": "opennms-helm-performance-datasource",
      "name": "OpenNMS Performance",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 9488,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1544470232934,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$onms_instance",
      "fill": 1,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 37,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "Total",
          "fill": 0
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "application": {
            "filter": ""
          },
          "attribute": "pgStatActTotal",
          "functions": [],
          "group": {
            "filter": ""
          },
          "host": {
            "filter": ""
          },
          "item": {
            "filter": ""
          },
          "label": "Total",
          "mode": 0,
          "nodeId": "$psql_instance",
          "options": {
            "showDisabledItems": false
          },
          "refId": "A",
          "resourceId": "nodeSnmp[]",
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          },
          "type": "attribute"
        },
        {
          "attribute": "pgStatActAct",
          "label": "Active",
          "nodeId": "$psql_instance",
          "refId": "B",
          "resourceId": "nodeSnmp[]",
          "type": "attribute"
        },
        {
          "attribute": "pgStatActIdle",
          "label": "Idle",
          "nodeId": "$psql_instance",
          "refId": "C",
          "resourceId": "nodeSnmp[]",
          "type": "attribute"
        },
        {
          "attribute": "pgStatActIdleTr",
          "label": "Idle in transaction",
          "nodeId": "$psql_instance",
          "refId": "D",
          "resourceId": "nodeSnmp[]",
          "type": "attribute"
        },
        {
          "attribute": "pgStatActIdleTrAb",
          "label": "Idle in transaction (aborted)",
          "nodeId": "$psql_instance",
          "refId": "E",
          "resourceId": "nodeSnmp[]",
          "type": "attribute"
        },
        {
          "attribute": "pgStatActDis",
          "label": "disabled",
          "nodeId": "$psql_instance",
          "refId": "F",
          "resourceId": "nodeSnmp[]",
          "type": "attribute"
        },
        {
          "attribute": "pgStatActFp",
          "label": "fastpath",
          "nodeId": "$psql_instance",
          "refId": "G",
          "resourceId": "nodeSnmp[]",
          "type": "attribute"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Connections $psql_instance",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 7
      },
      "id": 6,
      "panels": [],
      "repeat": "db",
      "title": "Database stats $psql_instance  $db",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$onms_instance",
      "fill": 1,
      "gridPos": {
        "h": 10,
        "w": 15,
        "x": 0,
        "y": 8
      },
      "id": 4,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "tup_deleted",
          "color": "#e24d42"
        },
        {
          "alias": "tup_returned",
          "color": "#6ed0e0"
        },
        {
          "alias": "tup_inserted",
          "color": "#508642"
        },
        {
          "alias": "tup_updated",
          "color": "#eab839"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "application": {
            "filter": ""
          },
          "attribute": "tup_inserted",
          "functions": [],
          "group": {
            "filter": ""
          },
          "host": {
            "filter": ""
          },
          "item": {
            "filter": ""
          },
          "label": "tup_inserted",
          "mode": 0,
          "nodeId": "$psql_instance",
          "options": {
            "showDisabledItems": false
          },
          "refId": "A",
          "resourceId": "$db",
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          },
          "type": "attribute"
        },
        {
          "attribute": "tup_returned",
          "nodeId": "$psql_instance",
          "refId": "B",
          "resourceId": "$db",
          "type": "attribute"
        },
        {
          "attribute": "tup_updated",
          "nodeId": "$psql_instance",
          "refId": "C",
          "resourceId": "$db",
          "type": "attribute"
        },
        {
          "attribute": "tup_deleted",
          "nodeId": "$psql_instance",
          "refId": "D",
          "resourceId": "$db",
          "type": "attribute"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Stats",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "ops",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$onms_instance",
      "fill": 1,
      "gridPos": {
        "h": 10,
        "w": 9,
        "x": 15,
        "y": 8
      },
      "id": 7,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "application": {
            "filter": ""
          },
          "attribute": "blks_read",
          "functions": [],
          "group": {
            "filter": ""
          },
          "host": {
            "filter": ""
          },
          "item": {
            "filter": ""
          },
          "label": "",
          "mode": 0,
          "nodeId": "$psql_instance",
          "options": {
            "showDisabledItems": false
          },
          "refId": "A",
          "resourceId": "$db",
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          },
          "type": "attribute"
        },
        {
          "attribute": "blks_hit",
          "nodeId": "$psql_instance",
          "refId": "B",
          "resourceId": "$db",
          "type": "attribute"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Disk Blocks",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$onms_instance",
      "decimals": null,
      "fill": 1,
      "gridPos": {
        "h": 9,
        "w": 7,
        "x": 0,
        "y": 18
      },
      "id": 8,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "application": {
            "filter": ""
          },
          "attribute": "db_size",
          "functions": [],
          "group": {
            "filter": ""
          },
          "host": {
            "filter": ""
          },
          "item": {
            "filter": ""
          },
          "label": "",
          "mode": 0,
          "nodeId": "$psql_instance",
          "options": {
            "showDisabledItems": false
          },
          "refId": "A",
          "resourceId": "$db",
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          },
          "type": "attribute"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Db Size",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "decbytes",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "decimals": null,
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$onms_instance",
      "decimals": null,
      "fill": 1,
      "gridPos": {
        "h": 9,
        "w": 10,
        "x": 7,
        "y": 18
      },
      "id": 9,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "xact_commit",
          "color": "#9ac48a"
        },
        {
          "alias": "xact_rollback",
          "color": "#bf1b00"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "application": {
            "filter": ""
          },
          "attribute": "xact_commit",
          "functions": [],
          "group": {
            "filter": ""
          },
          "host": {
            "filter": ""
          },
          "item": {
            "filter": ""
          },
          "label": "",
          "mode": 0,
          "nodeId": "$psql_instance",
          "options": {
            "showDisabledItems": false
          },
          "refId": "A",
          "resourceId": "$db",
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          },
          "type": "attribute"
        },
        {
          "attribute": "xact_rollback",
          "nodeId": "$psql_instance",
          "refId": "B",
          "resourceId": "$db",
          "type": "attribute"
        },
        {
          "attribute": "deadlocks",
          "nodeId": "$psql_instance",
          "refId": "C",
          "resourceId": "$db",
          "type": "attribute"
        },
        {
          "attribute": "conflicts",
          "nodeId": "$psql_instance",
          "refId": "D",
          "resourceId": "$db",
          "type": "attribute"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Transactions",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "decimals": null,
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$onms_instance",
      "decimals": null,
      "fill": 1,
      "gridPos": {
        "h": 9,
        "w": 7,
        "x": 17,
        "y": 18
      },
      "id": 17,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "temp_bytes",
          "yaxis": 2
        },
        {
          "alias": "temp_files",
          "yaxis": 1
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "application": {
            "filter": ""
          },
          "attribute": "temp_files",
          "functions": [],
          "group": {
            "filter": ""
          },
          "host": {
            "filter": ""
          },
          "item": {
            "filter": ""
          },
          "label": "",
          "mode": 0,
          "nodeId": "$psql_instance",
          "options": {
            "showDisabledItems": false
          },
          "refId": "A",
          "resourceId": "$db",
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          },
          "type": "attribute"
        },
        {
          "application": {
            "filter": ""
          },
          "attribute": "temp_bytes",
          "functions": [],
          "group": {
            "filter": ""
          },
          "host": {
            "filter": ""
          },
          "item": {
            "filter": ""
          },
          "label": "",
          "mode": 0,
          "nodeId": "$psql_instance",
          "options": {
            "showDisabledItems": false
          },
          "refId": "B",
          "resourceId": "$db",
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          },
          "type": "attribute"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Temp Files",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "decimals": null,
          "format": "decbytes",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "30s",
  "schemaVersion": 16,
  "style": "dark",
  "tags": [
    "postgresql",
    "OpenNMS"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "text": "OpenNMS FUL Performance",
          "value": "OpenNMS FUL Performance"
        },
        "hide": 0,
        "label": null,
        "name": "onms_instance",
        "options": [],
        "query": "opennms-helm-performance-datasource",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$onms_instance",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "psql_instance",
        "options": [],
        "query": "nodeFilter( isPostgreSQL ) ",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$onms_instance",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": true,
        "name": "db",
        "options": [],
        "query": "nodeResources($psql_instance)",
        "refresh": 1,
        "regex": "^pgDatabase\\[.*",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-2d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "OpenNMS - PostgreSQL Database Stats",
  "uid": "y6HXJTPmz",
  "version": 2,
  "description": "PostgreSQL database stats"
}