v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the observability v1alpha1 API group. +kubebuilder:object:generate=true +groupName=observability.slok.io

Index

Constants

View Source
const (
	ObjectiveConditionMet      = "met"
	ObjectiveConditionWarning  = "warning"
	ObjectiveConditionDegraded = "degraded"
	ObjectiveConditionCritical = "critical"
	ObjectiveConditionViolated = "violated"
	ObjectiveConditionUnknown  = "unknown"
)

Possible values for ObjectiveStatus.Status.

View Source
const (
	ConfidenceHigh   = "high"
	ConfidenceMedium = "medium"
	ConfidenceLow    = "low"
)

Confidence levels for correlated events

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "observability.slok.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Alerting

type Alerting struct {
	// budgetErrorAlerts configures error budget threshold alerts.
	// +optional
	BudgetErrorAlerts *BudgetErrors `json:"budgetErrorAlerts,omitempty"`

	// burnRateAlerts configures burn rate alerting rules.
	// +optional
	BurnRateAlerts *BurnRates `json:"burnRateAlerts,omitempty"`
}

Alerting configures the alerting behaviour for an objective. When enabled, PrometheusRule resources are created for budget and/or burn rate alerts. At least one of budgetErrorAlerts or burnRateAlerts must be specified. +kubebuilder:validation:XValidation:rule="has(self.budgetErrorAlerts) || has(self.burnRateAlerts)",message="at least one of budgetErrorAlerts or burnRateAlerts must be specified"

func (*Alerting) DeepCopy

func (in *Alerting) DeepCopy() *Alerting

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Alerting.

func (*Alerting) DeepCopyInto

func (in *Alerting) DeepCopyInto(out *Alerting)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BudgetAlert

type BudgetAlert struct {
	// name is the unique identifier for this budget alert.
	// +kubebuilder:validation:MinLength=1
	// +required
	Name string `json:"name"`

	// percent is the error budget remaining threshold below which the alert fires (e.g., 10.0 means < 10%).
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +required
	Percent float64 `json:"percent"`

	// severity is the alert severity level (e.g., "critical", "warning").
	// +kubebuilder:validation:Enum=critical;warning;info
	// +required
	Severity string `json:"severity"`
}

func (*BudgetAlert) DeepCopy

func (in *BudgetAlert) DeepCopy() *BudgetAlert

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BudgetAlert.

func (*BudgetAlert) DeepCopyInto

func (in *BudgetAlert) DeepCopyInto(out *BudgetAlert)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BudgetErrors

type BudgetErrors struct {
	// enabled controls whether budget error alerts are generated.
	// +required
	Enabled bool `json:"enabled"`

	// alerts is a list of budget alerting rules.
	// Each alert specifies a threshold percentage and severity level.
	// +optional
	Alerts []BudgetAlert `json:"alerts,omitempty"`
}

BudgetErrors configures error budget threshold alerting for an objective.

func (*BudgetErrors) DeepCopy

func (in *BudgetErrors) DeepCopy() *BudgetErrors

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BudgetErrors.

func (*BudgetErrors) DeepCopyInto

func (in *BudgetErrors) DeepCopyInto(out *BudgetErrors)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BurnRateAlert

type BurnRateAlert struct {
	// +kubebuilder:validation:MinLength=1
	// +required
	Name string `json:"name"`

	// consumePercent is the percentage of error budget that would be consumed
	// within the consumeWindow at the current burn rate to trigger the alert (e.g., 2.0 means 2%).
	// +kubebuilder:validation:Minimum=0
	// +required
	ConsumePercent float64 `json:"consumePercent"`

	// consumeWindow is the time window used to compute the burn rate threshold (e.g., "1h", "6h").
	// +kubebuilder:validation:Pattern=`^(\d+d|\d+h|\d+m|\d+s)$`
	// +required
	ConsumeWindow string `json:"consumeWindow"`

	// longWindow is the long observation window for the burn rate query (e.g., "1h").
	// +kubebuilder:validation:Pattern=`^(\d+d|\d+h|\d+m|\d+s)$`
	// +required
	LongWindow string `json:"longWindow"`

	// shortWindow is the short observation window for the burn rate query (e.g., "5m").
	// +kubebuilder:validation:Pattern=`^(\d+d|\d+h|\d+m|\d+s)$`
	// +required
	ShortWindow string `json:"shortWindow"`

	// severity is the alert severity level (e.g., "critical", "warning").
	// +kubebuilder:validation:Enum=critical;warning;info
	// +required
	Severity string `json:"severity"`
}

func (*BurnRateAlert) DeepCopy

func (in *BurnRateAlert) DeepCopy() *BurnRateAlert

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BurnRateAlert.

func (*BurnRateAlert) DeepCopyInto

func (in *BurnRateAlert) DeepCopyInto(out *BurnRateAlert)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BurnRateStatus

type BurnRateStatus struct {
	// shortWindow is the duration of the short observation window (e.g., "5m").
	ShortWindow string `json:"shortWindow"`

	// shortBurnRate is the burn rate computed over the short observation window.
	ShortBurnRate float64 `json:"shortBurnRate"`

	// longWindow is the duration of the long observation window (e.g., "1h").
	LongWindow string `json:"longWindow"`

	// longBurnRate is the burn rate computed over the long observation window.
	LongBurnRate float64 `json:"longBurnRate"`
}

BurnRateStatus represents the observed burn rate for an objective.

func (*BurnRateStatus) DeepCopy

func (in *BurnRateStatus) DeepCopy() *BurnRateStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BurnRateStatus.

func (*BurnRateStatus) DeepCopyInto

func (in *BurnRateStatus) DeepCopyInto(out *BurnRateStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BurnRates

type BurnRates struct {
	// enabled controls whether burn rate alerts are generated.
	// +required
	Enabled bool `json:"enabled"`

	// alerts is a list of custom burn rate alerting rules.
	// +optional
	Alerts []BurnRateAlert `json:"alerts,omitempty"`
}

BurnRates configures burn rate alerting for an objective.

func (*BurnRates) DeepCopy

func (in *BurnRates) DeepCopy() *BurnRates

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BurnRates.

func (*BurnRates) DeepCopyInto

func (in *BurnRates) DeepCopyInto(out *BurnRates)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Composition

type Composition struct {
	// +required
	// +kubebuilder:validation:Enum=AND_MIN;WEIGHTED_ROUTES
	Type string `json:"type"`
	// +optional
	Params *CompositionParams `json:"params,omitempty"`
}

+kubebuilder:validation:XValidation:rule="self.type == 'WEIGHTED_ROUTES' ? (has(self.params) && self.params.routes.size() > 0) : !has(self.params)",message="params with at least one route is required when type is WEIGHTED_ROUTES, and must not be set otherwise"

func (*Composition) DeepCopy

func (in *Composition) DeepCopy() *Composition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Composition.

func (*Composition) DeepCopyInto

func (in *Composition) DeepCopyInto(out *Composition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CompositionParams

type CompositionParams struct {
	Routes []Route `json:"routes,omitempty"`
}

+kubebuilder:validation:XValidation:rule="self.routes.map(r, r.weight).sum() >= 0.999 && self.routes.map(r, r.weight).sum() <= 1.001",message="route weights must sum to 1.0"

func (*CompositionParams) DeepCopy

func (in *CompositionParams) DeepCopy() *CompositionParams

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositionParams.

func (*CompositionParams) DeepCopyInto

func (in *CompositionParams) DeepCopyInto(out *CompositionParams)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CorrelatedEvent

type CorrelatedEvent struct {
	// kind is the Kubernetes resource kind (e.g., "Deployment", "ConfigMap")
	// +required
	Kind string `json:"kind"`

	// name is the name of the resource that changed
	// +required
	Name string `json:"name"`

	// namespace is the namespace of the resource
	// +required
	Namespace string `json:"namespace"`

	// timestamp is when the change occurred
	// +required
	Timestamp metav1.Time `json:"timestamp"`

	// changeType indicates what kind of change occurred (create, update, delete)
	// +kubebuilder:validation:Enum=create;update;delete
	// +required
	ChangeType string `json:"changeType"`

	// change describes what changed (e.g., "image: v1.4.2 → v1.4.3")
	// +optional
	Change string `json:"change,omitempty"`

	// actor is who or what triggered the change (e.g., "user@example.com", "argocd")
	// +optional
	Actor string `json:"actor,omitempty"`

	// confidence indicates how likely this event caused the SLO degradation
	// +kubebuilder:validation:Enum=high;medium;low
	// +required
	Confidence string `json:"confidence"`
}

CorrelatedEvent represents a Kubernetes change that may have caused the SLO degradation

func (*CorrelatedEvent) DeepCopy

func (in *CorrelatedEvent) DeepCopy() *CorrelatedEvent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelatedEvent.

func (*CorrelatedEvent) DeepCopyInto

func (in *CorrelatedEvent) DeepCopyInto(out *CorrelatedEvent)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ErrorBudgetStatus

type ErrorBudgetStatus struct {
	// Total error budget for the window (e.g., "43.2m" for 43.2 minutes)
	Total string `json:"total"`

	// Consumed error budget so far (e.g., "10.5m")
	Consumed string `json:"consumed"`

	// Remaining error budget (e.g., "32.7m")
	Remaining string `json:"remaining"`

	// PercentRemaining is the percentage of budget left (e.g., 75.69)
	PercentRemaining float64 `json:"percentRemaining"`
}

ErrorBudgetStatus represents error budget consumption

func (*ErrorBudgetStatus) DeepCopy

func (in *ErrorBudgetStatus) DeepCopy() *ErrorBudgetStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorBudgetStatus.

func (*ErrorBudgetStatus) DeepCopyInto

func (in *ErrorBudgetStatus) DeepCopyInto(out *ErrorBudgetStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Objective

type Objective struct {
	// name is the unique name of the objective within the Service Level Objective.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=100
	// +required
	Name string `json:"name"`

	// target is the target percentage for the objective (e.g., 99.9).
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=200
	// +required
	Target float64 `json:"target"`

	// window is the time window over which the objective is measured (e.g., "30d" for 30 days).
	// Only days are supported (e.g., "7d", "30d").
	// +kubebuilder:validation:Pattern=`^\d+d$`
	// +required
	Window string `json:"window"`

	// sli defines the Service Level Indicator used to measure this objective.
	// +required
	Sli SLI `json:"sli"`

	// alerting configures alerting rules (budget and burn rate) for this objective.
	// +optional
	Alerting *Alerting `json:"alerting,omitempty"`
}

Objective represents a single measurable target within a ServiceLevelObjective.

func (*Objective) DeepCopy

func (in *Objective) DeepCopy() *Objective

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Objective.

func (*Objective) DeepCopyInto

func (in *Objective) DeepCopyInto(out *Objective)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ObjectiveStatus

type ObjectiveStatus struct {
	// name of the objective (matches Objective.Name).
	Name string `json:"name"`

	// target percentage (copied from spec for convenience).
	Target float64 `json:"target"`

	// actual is the current SLI percentage (e.g., 99.87).
	Actual float64 `json:"actual"`

	// status indicates whether the objective is being met.
	// +kubebuilder:validation:Enum=met;warning;degraded;critical;violated;unknown
	Status string `json:"status"`

	// errorBudget contains details about error budget consumption.
	ErrorBudget ErrorBudgetStatus `json:"errorBudget"`

	// burnRate contains the observed burn rate metrics.
	// +optional
	BurnRate []BurnRateStatus `json:"burnRate,omitempty"`

	// lastQueried is the timestamp of the last Prometheus query for this objective.
	// +optional
	LastQueried metav1.Time `json:"lastQueried,omitempty"`
}

ObjectiveStatus represents the observed state of a single objective.

func (*ObjectiveStatus) DeepCopy

func (in *ObjectiveStatus) DeepCopy() *ObjectiveStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectiveStatus.

func (*ObjectiveStatus) DeepCopyInto

func (in *ObjectiveStatus) DeepCopyInto(out *ObjectiveStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Query

type Query struct {
	// totalQuery is the Prometheus metric selector for total events.
	// Example: http_requests_total{service="api"}
	// +kubebuilder:validation:MinLength=1
	// +required
	TotalQuery string `json:"totalQuery"`

	// errorQuery is the Prometheus metric selector for error events.
	// Example: http_requests_total{service="api",status=~"5.."}
	// +kubebuilder:validation:MinLength=1
	// +required
	ErrorQuery string `json:"errorQuery"`
}

Query holds the PromQL metric selectors used to compute the SLI error ratio. Required when not using a template.

func (*Query) DeepCopy

func (in *Query) DeepCopy() *Query

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Query.

func (*Query) DeepCopyInto

func (in *Query) DeepCopyInto(out *Query)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Route

type Route struct {
	Name   string   `json:"name"`
	Weight float64  `json:"weight"`
	Chain  []string `json:"chain"`
}

func (*Route) DeepCopy

func (in *Route) DeepCopy() *Route

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.

func (*Route) DeepCopyInto

func (in *Route) DeepCopyInto(out *Route)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SLI

type SLI struct {
	// query contains the manual Prometheus metric selectors.
	// Required if template is not specified.
	// +optional
	Query *Query `json:"query,omitempty"`

	// template specifies a predefined SLI template.
	// When set, query must not be specified.
	// +optional
	Template *TemplateStruct `json:"template,omitempty"`
}

SLI (Service Level Indicator) defines how the objective is measured. Use either a template (recommended) or manual queries, but not both. +kubebuilder:validation:XValidation:rule="has(self.query) != has(self.template)",message="exactly one of query or template must be specified"

func (*SLI) DeepCopy

func (in *SLI) DeepCopy() *SLI

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLI.

func (*SLI) DeepCopyInto

func (in *SLI) DeepCopyInto(out *SLI)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SLOComposition

type SLOComposition struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`

	// spec defines the desired state of SLOComposition
	// +required
	Spec SLOCompositionSpec `json:"spec"`

	// status defines the observed state of SLOComposition
	// +optional
	Status SLOCompositionStatus `json:"status,omitempty,omitzero"`
}

SLOComposition is the Schema for the slocompositions API

func (*SLOComposition) DeepCopy

func (in *SLOComposition) DeepCopy() *SLOComposition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOComposition.

func (*SLOComposition) DeepCopyInto

func (in *SLOComposition) DeepCopyInto(out *SLOComposition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SLOComposition) DeepCopyObject

func (in *SLOComposition) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SLOCompositionList

type SLOCompositionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SLOComposition `json:"items"`
}

SLOCompositionList contains a list of SLOComposition

func (*SLOCompositionList) DeepCopy

func (in *SLOCompositionList) DeepCopy() *SLOCompositionList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOCompositionList.

func (*SLOCompositionList) DeepCopyInto

func (in *SLOCompositionList) DeepCopyInto(out *SLOCompositionList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SLOCompositionList) DeepCopyObject

func (in *SLOCompositionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SLOCompositionSpec

type SLOCompositionSpec struct {
	// target is the target percentage for the objective (e.g., 99.9).
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=200
	// +required
	Target float64 `json:"target"`

	// window is the time window over which the objective is measured (e.g., "30d" for 30 days).
	// Only days are supported (e.g., "7d", "30d").
	// +kubebuilder:validation:Pattern=`^\d+d$`
	// +required
	Window string `json:"window"`

	// description is an optional human-readable description of the SLO.
	// +optional
	Description string `json:"description,omitempty,omitzero"`

	// +required
	Objectives []SLORef `json:"objectives"`

	// +required
	Composition Composition `json:"composition"`

	// alerting configures alerting rules (budget and burn rate) for this composition.
	// +optional
	Alerting *Alerting `json:"alerting,omitempty"`
}

SLOCompositionSpec defines the desired state of SLOComposition

func (*SLOCompositionSpec) DeepCopy

func (in *SLOCompositionSpec) DeepCopy() *SLOCompositionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOCompositionSpec.

func (*SLOCompositionSpec) DeepCopyInto

func (in *SLOCompositionSpec) DeepCopyInto(out *SLOCompositionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SLOCompositionStatus

type SLOCompositionStatus struct {
	// objectiveComposition represents the current status of the composed objective.
	// +optional
	ObjectiveComposition ObjectiveStatus `json:"objectiveComposition,omitempty"`

	// lastUpdateTime indicates the last time the status was updated.
	// +optional
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`

	// conditions represent the current state of the SLOComposition resource.
	// Each condition has a unique type and reflects the status of a specific aspect of the resource.
	//
	// Standard condition types include:
	// - "Available": the resource is fully functional
	// - "Progressing": the resource is being created or updated
	// - "Degraded": the resource failed to reach or maintain its desired state
	//
	// The status of each condition is one of True, False, or Unknown.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

SLOCompositionStatus defines the observed state of SLOComposition.

func (*SLOCompositionStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOCompositionStatus.

func (*SLOCompositionStatus) DeepCopyInto

func (in *SLOCompositionStatus) DeepCopyInto(out *SLOCompositionStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SLOCorrelation

type SLOCorrelation struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec defines the SLO reference
	// +required
	Spec SLOCorrelationSpec `json:"spec"`

	// status contains the correlation analysis results
	// +optional
	Status SLOCorrelationStatus `json:"status,omitempty"`
}

SLOCorrelation records a burn rate spike and correlated cluster changes

func (*SLOCorrelation) DeepCopy

func (in *SLOCorrelation) DeepCopy() *SLOCorrelation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOCorrelation.

func (*SLOCorrelation) DeepCopyInto

func (in *SLOCorrelation) DeepCopyInto(out *SLOCorrelation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SLOCorrelation) DeepCopyObject

func (in *SLOCorrelation) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SLOCorrelationList

type SLOCorrelationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SLOCorrelation `json:"items"`
}

SLOCorrelationList contains a list of SLOCorrelation

func (*SLOCorrelationList) DeepCopy

func (in *SLOCorrelationList) DeepCopy() *SLOCorrelationList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOCorrelationList.

func (*SLOCorrelationList) DeepCopyInto

func (in *SLOCorrelationList) DeepCopyInto(out *SLOCorrelationList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SLOCorrelationList) DeepCopyObject

func (in *SLOCorrelationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SLOCorrelationSpec

type SLOCorrelationSpec struct {
	// sloRef references the ServiceLevelObjective that triggered this correlation
	// +required
	SLORef SLOReference `json:"sloRef"`
}

SLOCorrelationSpec defines the desired state of SLOCorrelation Note: This is mostly empty as SLOCorrelation is created by the controller

func (*SLOCorrelationSpec) DeepCopy

func (in *SLOCorrelationSpec) DeepCopy() *SLOCorrelationSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOCorrelationSpec.

func (*SLOCorrelationSpec) DeepCopyInto

func (in *SLOCorrelationSpec) DeepCopyInto(out *SLOCorrelationSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SLOCorrelationStatus

type SLOCorrelationStatus struct {
	// detectedAt is when the burn rate spike was detected
	// +required
	DetectedAt metav1.Time `json:"detectedAt"`

	// burnRateAtDetection is the burn rate value when the spike was detected
	// +required
	BurnRateAtDetection float64 `json:"burnRateAtDetection"`

	// previousBurnRate is the burn rate from the previous reconcile
	// +optional
	PreviousBurnRate float64 `json:"previousBurnRate,omitempty"`

	// severity indicates the severity level that was triggered
	// +kubebuilder:validation:Enum=critical;degraded;warning
	// +required
	Severity string `json:"severity"`

	// window is the time range that was analyzed for correlations
	// +required
	Window TimeWindow `json:"window"`

	// correlatedEvents is the list of changes that may have caused the degradation
	// +optional
	CorrelatedEvents []CorrelatedEvent `json:"correlatedEvents,omitempty"`

	// summary is a human-readable description of the likely cause
	// +optional
	Summary string `json:"summary,omitempty"`

	// eventCount is the total number of events found in the window
	// +optional
	EventCount int `json:"eventCount,omitempty"`
}

SLOCorrelationStatus defines the observed state of SLOCorrelation

func (*SLOCorrelationStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOCorrelationStatus.

func (*SLOCorrelationStatus) DeepCopyInto

func (in *SLOCorrelationStatus) DeepCopyInto(out *SLOCorrelationStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SLOObjective

type SLOObjective struct {
	// name is the name of the objective (e.g., "availability", "latency").
	// +required
	Name string `json:"name"`

	// * optional namespace for the objective, if not specified it will be assumed to be in the same namespace as the SLOComposition.
	Namespace string `json:"namespace,omitempty"`
}

func (*SLOObjective) DeepCopy

func (in *SLOObjective) DeepCopy() *SLOObjective

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOObjective.

func (*SLOObjective) DeepCopyInto

func (in *SLOObjective) DeepCopyInto(out *SLOObjective)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SLORef

type SLORef struct {
	// name is the name of the SLO resource being referenced.
	// +required
	Name string `json:"name"`

	Ref SLOObjective `json:"ref"`
}

func (*SLORef) DeepCopy

func (in *SLORef) DeepCopy() *SLORef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLORef.

func (*SLORef) DeepCopyInto

func (in *SLORef) DeepCopyInto(out *SLORef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SLOReference

type SLOReference struct {
	// name is the name of the ServiceLevelObjective
	// +required
	Name string `json:"name"`

	// namespace is the namespace of the ServiceLevelObjective
	// +required
	Namespace string `json:"namespace"`
}

SLOReference identifies the SLO that triggered the correlation

func (*SLOReference) DeepCopy

func (in *SLOReference) DeepCopy() *SLOReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SLOReference.

func (*SLOReference) DeepCopyInto

func (in *SLOReference) DeepCopyInto(out *SLOReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceLevelObjective

type ServiceLevelObjective struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`

	// spec defines the desired state of ServiceLevelObjective
	// +required
	Spec ServiceLevelObjectiveSpec `json:"spec"`

	// status defines the observed state of ServiceLevelObjective
	// +optional
	Status ServiceLevelObjectiveStatus `json:"status,omitempty,omitzero"`
}

ServiceLevelObjective is the Schema for the servicelevelobjectives API

func (*ServiceLevelObjective) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjective.

func (*ServiceLevelObjective) DeepCopyInto

func (in *ServiceLevelObjective) DeepCopyInto(out *ServiceLevelObjective)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceLevelObjective) DeepCopyObject

func (in *ServiceLevelObjective) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ServiceLevelObjectiveList

type ServiceLevelObjectiveList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ServiceLevelObjective `json:"items"`
}

ServiceLevelObjectiveList contains a list of ServiceLevelObjective

func (*ServiceLevelObjectiveList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveList.

func (*ServiceLevelObjectiveList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceLevelObjectiveList) DeepCopyObject

func (in *ServiceLevelObjectiveList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ServiceLevelObjectiveSpec

type ServiceLevelObjectiveSpec struct {
	// displayName is the human-readable name for the Service Level Objective.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=255
	// +required
	DisplayName string `json:"displayName"`

	// objectives defines the objective for this Service Level Objective.
	// +required
	Objective Objective `json:"objective"`

	// workloadSelector defines which cluster workloads are related to this SLO.
	// Used by the correlation engine to filter relevant events during root cause analysis.
	// If not specified, all events in the SLO namespace are considered.
	// +optional
	WorkloadSelector *WorkloadSelector `json:"workloadSelector,omitempty"`
}

ServiceLevelObjectiveSpec defines the desired state of a ServiceLevelObjective.

func (*ServiceLevelObjectiveSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveSpec.

func (*ServiceLevelObjectiveSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceLevelObjectiveStatus

type ServiceLevelObjectiveStatus struct {
	// objectives represent the current status of each objective defined in the spec.
	// +optional
	Objective ObjectiveStatus `json:"objective,omitempty"`

	// lastUpdateTime indicates the last time the status was updated.
	// +optional
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
	// conditions represent the current state of the ServiceLevelObjective resource.
	// Each condition has a unique type and reflects the status of a specific aspect of the resource.
	//
	// Standard condition types include:
	// - "Available": the resource is fully functional
	// - "Progressing": the resource is being created or updated
	// - "Degraded": the resource failed to reach or maintain its desired state
	//
	// The status of each condition is one of True, False, or Unknown.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

ServiceLevelObjectiveStatus defines the observed state of ServiceLevelObjective.

func (*ServiceLevelObjectiveStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceLevelObjectiveStatus.

func (*ServiceLevelObjectiveStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TemplateStruct

type TemplateStruct struct {
	// name is the name of the template to use for this SLI.
	// Available templates: http-availability, http-latency, kubernetes-apiserver
	// +kubebuilder:validation:Enum=http-availability;http-latency;kubernetes-apiserver
	// +required
	Name string `json:"name"`

	// labels are the Prometheus label selectors to filter metrics.
	// Example: {"service": "payment-api", "namespace": "production"}
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// params are template-specific parameters.
	// For http-latency: threshold (e.g., "0.5" for 500ms)
	// +optional
	Params map[string]string `json:"params,omitempty"`
}

func (*TemplateStruct) DeepCopy

func (in *TemplateStruct) DeepCopy() *TemplateStruct

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateStruct.

func (*TemplateStruct) DeepCopyInto

func (in *TemplateStruct) DeepCopyInto(out *TemplateStruct)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TimeWindow

type TimeWindow struct {
	// start is the beginning of the analysis window
	// +required
	Start metav1.Time `json:"start"`

	// end is the end of the analysis window
	// +required
	End metav1.Time `json:"end"`
}

TimeWindow represents the time range analyzed for correlation

func (*TimeWindow) DeepCopy

func (in *TimeWindow) DeepCopy() *TimeWindow

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeWindow.

func (*TimeWindow) DeepCopyInto

func (in *TimeWindow) DeepCopyInto(out *TimeWindow)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkloadSelector

type WorkloadSelector struct {
	// labelSelector matches workloads by their labels.
	// Only resources with ALL specified labels will be included in correlation.
	// Example: {"app": "example-app", "team": "platform"}
	// +optional
	LabelSelector map[string]string `json:"labelSelector,omitempty"`

	// namespaces limits correlation to these namespaces.
	// If empty, only the SLO's namespace is used.
	// +optional
	Namespaces []string `json:"namespaces,omitempty"`
}

WorkloadSelector defines which cluster workloads are related to this SLO. Used by the correlation engine to filter relevant events during root cause analysis.

func (*WorkloadSelector) DeepCopy

func (in *WorkloadSelector) DeepCopy() *WorkloadSelector

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSelector.

func (*WorkloadSelector) DeepCopyInto

func (in *WorkloadSelector) DeepCopyInto(out *WorkloadSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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