v1alpha1

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the pyrra v1alpha1 API group +kubebuilder:object:generate=true +groupName=pyrra.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "pyrra.dev", 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 added in v0.5.0

type Alerting struct {
	// +optional
	// Disabled is used to disable the generation of alerts. Recording rules are still generated.
	Disabled *bool `json:"disabled,omitempty"`

	// +optional
	// Name is used as the name of the alert generated by Pyrra. Defaults to "ErrorBudgetBurn".
	Name string `json:"name,omitempty"`
}

func (*Alerting) DeepCopy added in v0.5.0

func (in *Alerting) DeepCopy() *Alerting

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

func (*Alerting) DeepCopyInto added in v0.5.0

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

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

type LatencyIndicator

type LatencyIndicator struct {
	// Success is the metric that returns how many errors there are.
	Success Query `json:"success"`
	// Total is the metric that returns how many requests there are in total.
	Total Query `json:"total"`
	// +optional
	// Grouping allows an SLO to be defined for many SLI at once, like HTTP handlers for example.
	Grouping []string `json:"grouping"`
}

func (*LatencyIndicator) DeepCopy

func (in *LatencyIndicator) DeepCopy() *LatencyIndicator

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

func (*LatencyIndicator) DeepCopyInto

func (in *LatencyIndicator) DeepCopyInto(out *LatencyIndicator)

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

type Query

type Query struct {
	Metric string `json:"metric"`
}

Query contains a PromQL metric.

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 RatioIndicator

type RatioIndicator struct {
	// Errors is the metric that returns how many errors there are.
	Errors Query `json:"errors"`
	// Total is the metric that returns how many requests there are in total.
	Total Query `json:"total"`
	// +optional
	// Grouping allows an SLO to be defined for many SLI at once, like HTTP handlers for example.
	Grouping []string `json:"grouping"`
}

func (*RatioIndicator) DeepCopy

func (in *RatioIndicator) DeepCopy() *RatioIndicator

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

func (*RatioIndicator) DeepCopyInto

func (in *RatioIndicator) DeepCopyInto(out *RatioIndicator)

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

type ServiceLevelIndicator

type ServiceLevelIndicator struct {
	// +optional
	// Ratio is the indicator that measures against errors / total events.
	Ratio *RatioIndicator `json:"ratio,omitempty"`

	// +optional
	// Latency is the indicator that measures a certain percentage to be fast than.
	Latency *LatencyIndicator `json:"latency,omitempty"`
}

ServiceLevelIndicator defines the underlying indicator that is a Prometheus metric.

func (*ServiceLevelIndicator) DeepCopy

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

func (*ServiceLevelIndicator) DeepCopyInto

func (in *ServiceLevelIndicator) DeepCopyInto(out *ServiceLevelIndicator)

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"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ServiceLevelObjectiveSpec   `json:"spec,omitempty"`
	Status ServiceLevelObjectiveStatus `json:"status,omitempty"`
}

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.

func (ServiceLevelObjective) Internal

func (in ServiceLevelObjective) Internal() (slo.Objective, error)

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 {
	// +optional
	// Description describes the ServiceLevelObjective in more detail and
	// gives extra context for engineers that might not directly work on the service.
	Description string `json:"description"`

	// Target is a string that's casted to a float64 between 0 - 100.
	// It represents the desired availability of the service in the given window.
	// float64 are not supported: https://github.com/kubernetes-sigs/controller-tools/issues/245
	Target string `json:"target"`

	// Window within which the Target is supposed to be kept. Usually something like 1d, 7d or 28d.
	Window string `json:"window"`

	// ServiceLevelIndicator is the underlying data source that indicates how the service is doing.
	// This will be a Prometheus metric with specific selectors for your service.
	ServiceLevelIndicator ServiceLevelIndicator `json:"indicator"`

	// +optional
	// Alerting customizes the alerting rules generated by Pyrra.
	Alerting Alerting `json:"alerting"`
}

ServiceLevelObjectiveSpec defines the desired state of 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{}

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.

Jump to

Keyboard shortcuts

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