Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics represent a set of Prometheus metrics for database client stats.
func NewMetrics ¶
func NewMetrics(opts ...MetricsOption) *Metrics
NewMetrics returns a new configured Metrics.
type MetricsOption ¶
type MetricsOption func(metrics *Metrics)
MetricsOption is an option for NewMetrics.
func MetricsWithConstLabels ¶ added in v0.2.0
func MetricsWithConstLabels(constLabels prometheus.Labels) MetricsOption
MetricsWithConstLabels is an option that sets metric constant labels.
func MetricsWithNamespace ¶
func MetricsWithNamespace(namespace string) MetricsOption
MetricsWithNamespace is an option that sets metric namespace.
func MetricsWithRegisterer ¶ added in v1.1.0
func MetricsWithRegisterer(registerer prometheus.Registerer) MetricsOption
MetricsWithRegisterer is an option that sets custom registerer for metrics.
func MetricsWithSubsystem ¶
func MetricsWithSubsystem(subsystem string) MetricsOption
MetricsWithSubsystem is an option that sets metric subsystem.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is a go-pg database client monitor.
func NewMonitor ¶
func NewMonitor(observer Observer, metrics *Metrics, opts ...MonitorOption) *Monitor
NewMonitor returns a new configured Monitor.
type MonitorOption ¶
type MonitorOption func(monitor *Monitor)
MonitorOption is an option for NewMonitor.
func MonitorWithPoolName ¶ added in v1.2.0
func MonitorWithPoolName(poolName string) MonitorOption
MonitorWithPoolName is an option that sets pool name for the monitor.