Documentation
¶
Overview ¶
Package canary watches progressive traffic shifts and rolls back on SLO breaches.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Steps []float64
Every time.Duration
MaxP95Latency time.Duration
MaxHTTP5xxRate float64
}
Config defines the release progression and SLO boundaries.
func ConfigFromDeploy ¶
func ConfigFromDeploy(deploy *ast.DeployDecl) (Config, error)
ConfigFromDeploy derives canary steps, interval, and SLO limits from an AxLang deploy.
type HTTPController ¶
type HTTPController struct {
BaseURL string
ShiftPath string
RollbackPath string
Token string
Client *http.Client
}
HTTPController calls a deployment service to change traffic weight or roll back.
type MetricsSource ¶
MetricsSource supplies canary health metrics.
type PrometheusSource ¶
type PrometheusSource struct {
BaseURL string
P95Query string
HTTP5xxQuery string
Client *http.Client
}
PrometheusSource reads latency and 5xx metrics from the Prometheus query API.
type TrafficController ¶
type TrafficController interface {
Shift(context.Context, float64) error
Rollback(context.Context) error
}
TrafficController shifts traffic and can restore the previous stable version.
type Watcher ¶
type Watcher struct {
Metrics MetricsSource
Traffic TrafficController
}
Watcher observes metrics after each canary step and stops on the first violation.
Click to show internal directories.
Click to hide internal directories.