Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadDB = errors.New("db is nil") ErrDBExists = errors.New("db already exists") )
Functions ¶
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter exports sql.DBStats as Prometheus metrics.
func FromContext ¶
FromContext returns the Exporter bound to the context, if any.
func NewExporter ¶
type Metrics ¶
type Metrics struct { MaxOpenConnections *prometheus.GaugeVec // Maximum number of open connections to the database. // Pool Status OpenConnections *prometheus.GaugeVec // The number of established connections both in use and idle. InUse *prometheus.GaugeVec // The number of connections currently in use. Idle *prometheus.GaugeVec // The number of idle connections. // Counters WaitCount *metric.SettableCounterVec // The total number of connections waited for. WaitDuration *metric.SettableCounterVec // The total time (in seconds) blocked waiting for a new connection. MaxIdleClosed *metric.SettableCounterVec // The total number of connections closed due to SetMaxIdleConns. MaxLifetimeClosed *metric.SettableCounterVec // The total number of connections closed due to SetConnMaxLifetime. }
Metrics for sql.DBStats.
Click to show internal directories.
Click to hide internal directories.