diff --git a/internal/collector/metrics.go b/internal/collector/metrics.go index 1af11d7..20f32c7 100644 --- a/internal/collector/metrics.go +++ b/internal/collector/metrics.go @@ -232,6 +232,22 @@ func buildMetrics(cfg config.Config) []metric { return results }, }, + { + enabled: cfg.ExportDatabases, + name: fqName(SubsystemDatabases, "pool_size"), + help: "Maximum number of server connections.", + labels: []string{"name", "pool_mode"}, + valType: prometheus.GaugeValue, + eval: func(res *storeResult) (results []metricResult) { + for _, database := range res.databases { + results = append(results, metricResult{ + labels: []string{database.Name, database.PoolMode}, + value: float64(database.PoolSize), + }) + } + return results + }, + }, { enabled: cfg.ExportDatabases, name: fqName(SubsystemDatabases, "current_connections"), @@ -248,6 +264,22 @@ func buildMetrics(cfg config.Config) []metric { return results }, }, + { + enabled: cfg.ExportDatabases, + name: fqName(SubsystemDatabases, "max_connections"), + help: "Maximum number of allowed connections for this database.", + labels: []string{"name", "pool_mode"}, + valType: prometheus.GaugeValue, + eval: func(res *storeResult) (results []metricResult) { + for _, database := range res.databases { + results = append(results, metricResult{ + labels: []string{database.Name, database.PoolMode}, + value: float64(database.MaxConnections), + }) + } + return results + }, + }, { enabled: cfg.ExportLists, name: fqName(SubsystemLists, "items"),