Documentation
¶
Index ¶
- Constants
- func APIKeyAuthMiddleware(config types.JobConfiguration) echo.MiddlewareFunc
- func HealthMetricsMiddleware(healthMetrics *HealthMetrics) echo.MiddlewareFunc
- func Healthz() func(c echo.Context) error
- func Readyz(jobServer *jobserver.JobServer, healthMetrics *HealthMetrics) func(c echo.Context) error
- func Start(ctx context.Context, listenAddress, dataDIR string, standalone bool, ...) error
- type HealthMetrics
- type HealthzResponse
- type ReadinessChecks
- type ReadyzResponse
Constants ¶
View Source
const HealthCheckPath = "/healthz"
View Source
const ReadinessCheckPath = "/readyz"
Variables ¶
This section is empty.
Functions ¶
func APIKeyAuthMiddleware ¶ added in v1.1.0
func APIKeyAuthMiddleware(config types.JobConfiguration) echo.MiddlewareFunc
APIKeyAuthMiddleware returns an Echo middleware that checks for the API key in the request headers.
func HealthMetricsMiddleware ¶ added in v1.3.3
func HealthMetricsMiddleware(healthMetrics *HealthMetrics) echo.MiddlewareFunc
HealthMetricsMiddleware tracks success and error rates for readiness probe
Types ¶
type HealthMetrics ¶ added in v1.3.3
type HealthMetrics struct {
// contains filtered or unexported fields
}
HealthMetrics tracks health-related metrics for the service
func NewHealthMetrics ¶ added in v1.3.3
func NewHealthMetrics() *HealthMetrics
NewHealthMetrics creates a new health metrics tracker
func (*HealthMetrics) GetStats ¶ added in v1.3.3
func (hm *HealthMetrics) GetStats() map[string]interface{}
GetStats returns current health statistics
func (*HealthMetrics) IsHealthy ¶ added in v1.3.3
func (hm *HealthMetrics) IsHealthy() bool
IsHealthy checks if the service is healthy based on error rate
func (*HealthMetrics) RecordError ¶ added in v1.3.3
func (hm *HealthMetrics) RecordError()
RecordError records an error
func (*HealthMetrics) RecordSuccess ¶ added in v1.3.3
func (hm *HealthMetrics) RecordSuccess()
RecordSuccess records a successful request
type HealthzResponse ¶ added in v1.3.3
HealthzResponse represents the liveness probe response
type ReadinessChecks ¶ added in v1.3.3
type ReadinessChecks struct {
JobServer string `json:"job_server"`
ErrorRate string `json:"error_rate"`
Stats map[string]interface{} `json:"stats,omitempty"`
}
ReadinessChecks contains individual readiness check results
type ReadyzResponse ¶ added in v1.3.3
type ReadyzResponse struct {
Service string `json:"service"`
Ready bool `json:"ready"`
Checks ReadinessChecks `json:"checks"`
}
ReadyzResponse represents the readiness probe response
Click to show internal directories.
Click to hide internal directories.