observability

package
v0.31.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueueMonitor added in v0.22.0

type QueueMonitor struct {
	// contains filtered or unexported fields
}

func NewQueueMonitor added in v0.22.0

func NewQueueMonitor(store QueueStatsStore, metrics *Service, logger *slog.Logger, cfg QueueMonitorConfig) (*QueueMonitor, error)

func (*QueueMonitor) Done added in v0.22.0

func (m *QueueMonitor) Done() <-chan struct{}

func (*QueueMonitor) Run added in v0.22.0

func (m *QueueMonitor) Run(ctx context.Context)

func (*QueueMonitor) Shutdown added in v0.22.0

func (m *QueueMonitor) Shutdown(ctx context.Context) error

type QueueMonitorConfig added in v0.22.0

type QueueMonitorConfig struct {
	Interval          time.Duration
	Timeout           time.Duration
	EmailStaleAfter   func() time.Duration
	WebhookStaleAfter func() time.Duration
}

type QueueStatsStore added in v0.22.0

type QueueStatsStore interface {
	EmailQueueStats(context.Context, time.Time, time.Time) (store.QueueStats, error)
	WebhookQueueStats(context.Context, time.Time, time.Time) (store.QueueStats, error)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(version string) *Service

func (*Service) Handler

func (s *Service) Handler() http.Handler

func (*Service) Middleware

func (s *Service) Middleware(next http.Handler) http.Handler

func (*Service) ObserveBackgroundJob

func (s *Service) ObserveBackgroundJob(worker, outcome string, duration time.Duration)

ObserveBackgroundJob records the result and processing time of an asynchronous job.

func (*Service) ObserveBackgroundPoll added in v0.22.0

func (s *Service) ObserveBackgroundPoll(worker, result string, duration time.Duration)

func (*Service) ObserveEmailQueueAge added in v0.22.0

func (s *Service) ObserveEmailQueueAge(outcome string, age time.Duration)

func (*Service) ObserveMaintenanceLease added in v0.22.0

func (s *Service) ObserveMaintenanceLease(outcome string)

func (*Service) ObserveMaintenanceRun added in v0.22.0

func (s *Service) ObserveMaintenanceRun(job, outcome string, duration time.Duration, rows int64)

func (*Service) ObserveQueueReaper added in v0.22.0

func (s *Service) ObserveQueueReaper(queue, result string, duration time.Duration, retried, failed int64)

func (*Service) ObserveQueueSnapshot added in v0.22.0

func (s *Service) ObserveQueueSnapshot(queue, result string, stats store.QueueStats, now time.Time)

func (*Service) ObserveReadinessCheck added in v0.22.0

func (s *Service) ObserveReadinessCheck(dependency, result string)

func (*Service) ObserveReadinessCheckDuration added in v0.22.0

func (s *Service) ObserveReadinessCheckDuration(dependency, result string, duration time.Duration)

func (*Service) ObserveRuntimeSettingsReconciliation added in v0.22.0

func (s *Service) ObserveRuntimeSettingsReconciliation(result string, duration time.Duration, revision int64)

func (*Service) RegisterDatabase

func (s *Service) RegisterDatabase(db *sql.DB, name string) error

RegisterDatabase exposes database/sql pool saturation and connection churn.

func (*Service) Registerer

func (s *Service) Registerer() prometheus.Registerer

Registerer allows application modules to register additional collectors without relying on Prometheus's global registry.

func (*Service) SetMaintenanceLeader added in v0.22.0

func (s *Service) SetMaintenanceLeader(leader bool)

func (*Service) SetReadiness added in v0.22.0

func (s *Service) SetReadiness(ready bool)

func (*Service) SetRuntimeSettingsRevision added in v0.22.0

func (s *Service) SetRuntimeSettingsRevision(revision int64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL