Documentation ¶
Overview ¶
Example ¶
ctx := context.Background() logger := zap.NewNop() // Your database db := &sql.DB{} dbMonitor := NewPostgresMonitorsWithMetrics("", db, logger) monitor := &health.Monitor{} monitor.AddProber(ctx, dbMonitor) go monitor.RunChecks(ctx, 1*time.Second) // Attach endpoints mux := http.NewServeMux() monitor.AttachHttp(mux)
Output:
Index ¶
- type PingCheck
- type PostgresMonitor
- func (m *PostgresMonitor) Liveness(ctx context.Context) (probetype, redinesstype, name string, contents interface{}, err error)
- func (m *PostgresMonitor) Probe(ctx context.Context) (err error)
- func (m *PostgresMonitor) Readiness(ctx context.Context) (probetype, redinesstype, name string, contents interface{}, err error)
- type SizeCheck
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresMonitor ¶
type PostgresMonitor struct {
// contains filtered or unexported fields
}
func NewPostgresMonitor ¶
func NewPostgresMonitorWithMetrics ¶
func NewPostgresMonitorWithMetrics(db *sql.DB, l *zap.Logger) *PostgresMonitor
func NewPostgresMonitorsWithMetrics ¶ added in v0.4.1
Click to show internal directories.
Click to hide internal directories.