Skip to main content
Glama
db-pool-eviction-metrics.json14.3 kB
{ "id": null, "uid": "db-pool-eviction-metrics", "title": "Database Pool Eviction Metrics", "tags": [ "database", "connection-pool", "eviction", "postgres" ], "timezone": "browser", "schemaVersion": 16, "version": 0, "refresh": "5s", "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "templating": { "list": [ { "name": "datasource", "type": "datasource", "label": "Data Source", "query": "prometheus", "refresh": 1, "hide": 0 }, { "name": "service", "type": "query", "label": "Service", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "query": "label_values(db_pool_eviction_connections_checked, exported_job)", "refresh": 2, "sort": 1, "multi": true, "includeAll": true, "allValue": null }, { "name": "instance", "type": "query", "label": "Instance", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "query": "label_values(db_pool_eviction_connections_checked{exported_job=~\"$service\"}, instance)", "refresh": 2, "sort": 1, "multi": true, "includeAll": true, "allValue": null } ] }, "panels": [ { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 100, "panels": [], "title": "Health", "type": "row" }, { "id": 1, "gridPos": { "x": 0, "y": 1, "w": 24, "h": 4 }, "type": "stat", "title": "Pool Activity - Connections Checked", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "db_pool_eviction_connections_checked{exported_job=~\"$service\",instance=~\"$instance\"}", "legendFormat": "{{exported_job}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "short", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "red" }, { "value": 1, "color": "green" } ] }, "min": 0 } }, "options": { "textMode": "value_and_name", "colorMode": "background", "graphMode": "area", "orientation": "auto", "reduceOptions": { "values": false, "calcs": [ "lastNotNull" ] } } }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 }, "id": 101, "panels": [], "title": "Eviction Activity", "type": "row" }, { "id": 2, "gridPos": { "x": 0, "y": 6, "w": 24, "h": 8 }, "type": "timeseries", "title": "Recent Evictions by Reason (5m windows)", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "increase(db_pool_eviction_connections_removed_total{exported_job=~\"$service\",instance=~\"$instance\"}[5m])", "legendFormat": "{{exported_job}} - {{reason}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "short", "color": { "mode": "palette-classic" }, "custom": { "lineWidth": 2, "fillOpacity": 20, "showPoints": "never", "stacking": { "mode": "normal" } } } }, "options": { "tooltip": { "mode": "multi", "sort": "desc" }, "legend": { "displayMode": "table", "placement": "right", "calcs": [ "lastNotNull", "max", "mean" ] } } }, { "id": 3, "gridPos": { "x": 0, "y": 14, "w": 8, "h": 4 }, "type": "stat", "title": "Dead Connections (already_closed)", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "increase(db_pool_eviction_connections_removed_total{exported_job=~\"$service\",instance=~\"$instance\",reason=\"already_closed\"}[$__range])", "legendFormat": "{{exported_job}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "short", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "green" }, { "value": 10, "color": "yellow" }, { "value": 50, "color": "red" } ] }, "min": 0 } }, "options": { "textMode": "value_and_name", "colorMode": "background", "graphMode": "area", "orientation": "auto", "reduceOptions": { "values": false, "calcs": [ "lastNotNull" ] } } }, { "id": 4, "gridPos": { "x": 8, "y": 14, "w": 8, "h": 4 }, "type": "stat", "title": "Idle Reclaimed (idle_timeout)", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "increase(db_pool_eviction_connections_removed_total{exported_job=~\"$service\",instance=~\"$instance\",reason=\"idle_timeout\"}[$__range])", "legendFormat": "{{exported_job}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "short", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "green" } ] }, "min": 0 } }, "options": { "textMode": "value_and_name", "colorMode": "background", "graphMode": "area", "orientation": "auto", "reduceOptions": { "values": false, "calcs": [ "lastNotNull" ] } } }, { "id": 5, "gridPos": { "x": 16, "y": 14, "w": 8, "h": 4 }, "type": "stat", "title": "Age Limit Hit (max_age)", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "increase(db_pool_eviction_connections_removed_total{exported_job=~\"$service\",instance=~\"$instance\",reason=\"max_age\"}[$__range])", "legendFormat": "{{exported_job}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "short", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "green" }, { "value": 1, "color": "yellow" }, { "value": 10, "color": "red" } ] }, "min": 0 } }, "options": { "textMode": "value_and_name", "colorMode": "background", "graphMode": "area", "orientation": "auto", "reduceOptions": { "values": false, "calcs": [ "lastNotNull" ] } } }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 18 }, "id": 102, "panels": [], "title": "Pool Health Indicators", "type": "row" }, { "id": 6, "gridPos": { "x": 0, "y": 19, "w": 12, "h": 8 }, "type": "timeseries", "title": "Oldest Connection Age", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "db_pool_connection_max_age_seconds{exported_job=~\"$service\",instance=~\"$instance\"}", "legendFormat": "{{exported_job}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "s", "color": { "mode": "palette-classic" }, "custom": { "lineWidth": 2, "fillOpacity": 10, "showPoints": "never" } } }, "options": { "tooltip": { "mode": "multi", "sort": "desc" }, "legend": { "displayMode": "table", "placement": "right", "calcs": [ "lastNotNull", "max", "mean" ] } } }, { "id": 7, "gridPos": { "x": 12, "y": 19, "w": 12, "h": 8 }, "type": "timeseries", "title": "Maximum Idle Time", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "db_pool_connection_max_idle_seconds{exported_job=~\"$service\",instance=~\"$instance\"}", "legendFormat": "{{exported_job}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "s", "color": { "mode": "palette-classic" }, "custom": { "lineWidth": 2, "fillOpacity": 10, "showPoints": "never" } } }, "options": { "tooltip": { "mode": "multi", "sort": "desc" }, "legend": { "displayMode": "table", "placement": "right", "calcs": [ "lastNotNull", "max", "mean" ] } } }, { "id": 8, "gridPos": { "x": 0, "y": 27, "w": 24, "h": 8 }, "type": "timeseries", "title": "Connections Checked Per Cycle", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "db_pool_eviction_connections_checked{exported_job=~\"$service\",instance=~\"$instance\"}", "legendFormat": "{{exported_job}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "short", "color": { "mode": "palette-classic" }, "custom": { "lineWidth": 2, "fillOpacity": 10, "showPoints": "never" } } }, "options": { "tooltip": { "mode": "multi", "sort": "desc" }, "legend": { "displayMode": "table", "placement": "right", "calcs": [ "lastNotNull", "max", "mean" ] } } }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 35 }, "id": 103, "panels": [], "title": "Eviction Distribution", "type": "row" }, { "id": 9, "gridPos": { "x": 0, "y": 36, "w": 24, "h": 8 }, "type": "bargauge", "title": "Eviction Reason Distribution", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "increase(db_pool_eviction_connections_removed_total{exported_job=~\"$service\",instance=~\"$instance\"}[$__range])", "legendFormat": "{{exported_job}} - {{reason}}", "refId": "A" } ], "fieldConfig": { "defaults": { "unit": "short", "color": { "mode": "palette-classic" }, "min": 0 } }, "options": { "orientation": "horizontal", "displayMode": "gradient", "showUnfilled": true, "text": { "valueSize": 20 } } } ] }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server