33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package health
|
|
|
|
// TaskMetricsObserver accepts only the low-cardinality dimensions emitted by
|
|
// Checker task processing. Implementations must not add task, proxy, checker,
|
|
// endpoint, target URL, or credential values as metric labels.
|
|
type TaskMetricsObserver interface {
|
|
ObserveTaskDispatch(Level, int)
|
|
ObserveObservation(Level, ObservationMetricResult)
|
|
}
|
|
|
|
// DrainReason is intentionally finite so Controller metrics cannot expose
|
|
// upstream, proxy, Worker, session or endpoint identity as labels.
|
|
type DrainReason string
|
|
|
|
const (
|
|
DrainReasonUnhealthy DrainReason = "unhealthy"
|
|
DrainReasonUpstreamDisabled DrainReason = "upstream_disabled"
|
|
)
|
|
|
|
// DrainMetricsObserver records bounded Controller-side Drain attempts after a
|
|
// complete sweep. Candidate and started counts are separate because a fenced
|
|
// candidate may legitimately become stale before the ownership transition.
|
|
type DrainMetricsObserver interface {
|
|
ObserveDrain(reason DrainReason, candidates, started int)
|
|
}
|
|
|
|
type ObservationMetricResult string
|
|
|
|
const (
|
|
ObservationMetricAccepted ObservationMetricResult = "accepted"
|
|
ObservationMetricRejected ObservationMetricResult = "rejected"
|
|
)
|