Versions in this module Expand all Collapse all v1 v1.2.3 Sep 4, 2025 Changes in this version + func CheckHealth() error + func GetDB() (*sql.DB, error) + func GetDialect() string + func IsConnected() bool + type DBPgsqlClient struct + func NewPgsqlClient() *DBPgsqlClient + func (p *DBPgsqlClient) CleanupTasks() error + func (p *DBPgsqlClient) StartupTasks() error + type PrometheusConfig struct + Labels map[string]string + Namespace string + Subsystem string + type PrometheusMetrics struct + ConfigMaxConn *prometheus.GaugeVec + ConfigMinConn *prometheus.GaugeVec + ConnectAttempts *prometheus.CounterVec + ConnectFailures *prometheus.CounterVec + ConnectRetries *prometheus.CounterVec + ConnectSuccess *prometheus.CounterVec + ErrorCounter *prometheus.CounterVec + HealthCheckFailure *prometheus.CounterVec + HealthCheckSuccess *prometheus.CounterVec + HealthCheckTotal *prometheus.CounterVec + IdleConnections *prometheus.GaugeVec + InUseConnections *prometheus.GaugeVec + MaxIdleClosed *prometheus.CounterVec + MaxIdleConnections *prometheus.GaugeVec + MaxLifetimeClosed *prometheus.CounterVec + MaxOpenConnections *prometheus.GaugeVec + OpenConnections *prometheus.GaugeVec + QueryDuration *prometheus.HistogramVec + SlowQueryCnt *prometheus.CounterVec + TxDuration *prometheus.HistogramVec + WaitCount *prometheus.CounterVec + WaitDuration *prometheus.CounterVec + func NewPrometheusMetrics(config *PrometheusConfig) *PrometheusMetrics + func (m *PrometheusMetrics) UpdateMetrics(stats *base.ConnectionPoolStats, config *conf.Pgsql) + func (pm *PrometheusMetrics) GetGatherer() prometheus.Gatherer + func (pm *PrometheusMetrics) IncConnectAttempt(config *conf.Pgsql) + func (pm *PrometheusMetrics) IncConnectFailure(config *conf.Pgsql) + func (pm *PrometheusMetrics) IncConnectRetry(config *conf.Pgsql) + func (pm *PrometheusMetrics) IncConnectSuccess(config *conf.Pgsql) + func (pm *PrometheusMetrics) RecordHealthCheck(success bool, config *conf.Pgsql) + func (pm *PrometheusMetrics) RecordQuery(op string, dur time.Duration, err error, threshold time.Duration, ...) + func (pm *PrometheusMetrics) RecordTx(dur time.Duration, committed bool, config *conf.Pgsql)