Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartMonitoringServer ¶
func StartMonitoringServer( ctx context.Context, log *slog.Logger, reg *prometheus.Registry, dtb *pgxpool.Pool, port int, parseHost string, )
StartMonitoringServer starts an HTTP server that provides health check and metrics endpoints. It listens on the specified port and logs the server's status and any errors encountered.
Parameters: - ctx: A context.Context for managing cancellation and timeouts. - log: A logger for logging server events and errors. - reg: A registry with Prometheus collectors. - dtb: A pgxpool connector for database methods (ping) - port: The port number on which the server will listen.
Types ¶
type HealthChecker ¶
type HealthChecker struct {
// contains filtered or unexported fields
}
func NewHealthChecker ¶
func NewHealthChecker(db DBPinger, parseHost string, log *slog.Logger) *HealthChecker
func (*HealthChecker) ServeHTTP ¶
func (h *HealthChecker) ServeHTTP(writer http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.