diff --git a/CHANGELOG.md b/CHANGELOG.md index 62299484..0f5ee13e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## [Unreleased] +## [v0.13.2] - 2024-10-31 + +- Set infoLabels to optional +- Ran `make gen` + ## [v0.13.1] - 2024-10-31 - Update Mockery from 2.14.0 to 2.46.3 @@ -188,7 +193,9 @@ - Support raw query based SLI. - Kubernetes (prometheus-operator) CRD generation support. -[unreleased]: https://github.com/linode-obs/sloth/compare/v0.13.0...HEAD +[unreleased]: https://github.com/linode-obs/sloth/compare/v0.13.2...HEAD +[v0.13.2]: https://github.com/slok/sloth/compare/v0.13.1...v0.13.2 +[v0.13.1]: https://github.com/slok/sloth/compare/v0.13.0...v0.13.1 [v0.13.0]: https://github.com/slok/sloth/compare/v0.12.0...v0.13.0 [v0.12.0]: https://github.com/slok/sloth/compare/v0.11.0...v0.12.0 [v0.11.0]: https://github.com/slok/sloth/compare/v0.10.0...v0.11.0 diff --git a/deploy/kubernetes/raw/sloth-with-common-plugins.yaml b/deploy/kubernetes/raw/sloth-with-common-plugins.yaml index dfd0a983..0b055fb9 100644 --- a/deploy/kubernetes/raw/sloth-with-common-plugins.yaml +++ b/deploy/kubernetes/raw/sloth-with-common-plugins.yaml @@ -6,7 +6,7 @@ metadata: name: sloth namespace: monitoring labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -18,7 +18,7 @@ kind: ClusterRole metadata: name: sloth labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -38,7 +38,7 @@ kind: ClusterRoleBinding metadata: name: sloth labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -59,7 +59,7 @@ metadata: name: sloth namespace: monitoring labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -74,7 +74,7 @@ spec: template: metadata: labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -89,6 +89,7 @@ spec: args: - kubernetes-controller - --sli-plugins-path=/plugins + - --logger=default ports: - containerPort: 8081 name: metrics @@ -132,7 +133,7 @@ metadata: name: sloth namespace: monitoring labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth diff --git a/deploy/kubernetes/raw/sloth.yaml b/deploy/kubernetes/raw/sloth.yaml index 84476298..9630ef2f 100644 --- a/deploy/kubernetes/raw/sloth.yaml +++ b/deploy/kubernetes/raw/sloth.yaml @@ -6,7 +6,7 @@ metadata: name: sloth namespace: monitoring labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -18,7 +18,7 @@ kind: ClusterRole metadata: name: sloth labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -38,7 +38,7 @@ kind: ClusterRoleBinding metadata: name: sloth labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -59,7 +59,7 @@ metadata: name: sloth namespace: monitoring labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -74,7 +74,7 @@ spec: template: metadata: labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth @@ -88,6 +88,7 @@ spec: image: ghcr.io/linode-obs/sloth:v0.13.1 args: - kubernetes-controller + - --logger=default ports: - containerPort: 8081 name: metrics @@ -107,7 +108,7 @@ metadata: name: sloth namespace: monitoring labels: - helm.sh/chart: sloth-0.6.4 + helm.sh/chart: sloth-0.8.2 app.kubernetes.io/managed-by: Helm app: sloth app.kubernetes.io/name: sloth diff --git a/internal/prometheus/model.go b/internal/prometheus/model.go index 77e711ed..ac24a662 100644 --- a/internal/prometheus/model.go +++ b/internal/prometheus/model.go @@ -53,7 +53,7 @@ type SLO struct { Labels map[string]string `validate:"dive,keys,prom_label_key,endkeys,required,prom_label_value"` PageAlertMeta AlertMeta TicketAlertMeta AlertMeta - InfoLabels map[string]string `validate:"dive,keys,prom_label_key,endkeys,required,prom_label_value"` + InfoLabels map[string]string `validate:"dive,keys,prom_label_key,endkeys,prom_label_value"` } type SLOGroup struct { diff --git a/pkg/kubernetes/api/sloth/v1/README.md b/pkg/kubernetes/api/sloth/v1/README.md index 607d255c..ac83b332 100755 --- a/pkg/kubernetes/api/sloth/v1/README.md +++ b/pkg/kubernetes/api/sloth/v1/README.md @@ -90,7 +90,7 @@ func VersionKind(kind string) schema.GroupVersionKind VersionKind takes an unqualified kind and returns back a Group qualified GroupVersionKind. -## type [Alert]() +## type [Alert]() Alert configures specific SLO alert. @@ -127,7 +127,7 @@ func (in *Alert) DeepCopyInto(out *Alert) DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non\-nil. -## type [Alerting]() +## type [Alerting]() Alerting wraps all the configuration required by the SLO alerts. @@ -210,7 +210,7 @@ func (in *PrometheusServiceLevel) DeepCopyObject() runtime.Object DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -## type [PrometheusServiceLevelList]() +## type [PrometheusServiceLevelList]() \+k8s:deepcopy\-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -287,7 +287,7 @@ func (in *PrometheusServiceLevelSpec) DeepCopyInto(out *PrometheusServiceLevelSp DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non\-nil. -## type [PrometheusServiceLevelStatus]() +## type [PrometheusServiceLevelStatus]() ```go type PrometheusServiceLevelStatus struct { @@ -323,7 +323,7 @@ func (in *PrometheusServiceLevelStatus) DeepCopyInto(out *PrometheusServiceLevel DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non\-nil. -## type [SLI]() +## type [SLI]() SLI will tell what is good or bad for the SLO. All SLIs will be get based on time windows, that's why Sloth needs the queries to use \`\{\{.window\}\}\` template variable. @@ -361,7 +361,7 @@ func (in *SLI) DeepCopyInto(out *SLI) DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non\-nil. -## type [SLIEvents]() +## type [SLIEvents]() SLIEvents is an SLI that is calculated as the division of bad events and total events, giving a ratio SLI. Normally this is the most common ratio type. @@ -395,7 +395,7 @@ func (in *SLIEvents) DeepCopyInto(out *SLIEvents) DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non\-nil. -## type [SLIPlugin]() +## type [SLIPlugin]() SLIPlugin will use the SLI returned by the SLI plugin selected along with the options. @@ -426,7 +426,7 @@ func (in *SLIPlugin) DeepCopyInto(out *SLIPlugin) DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non\-nil. -## type [SLIRaw]() +## type [SLIRaw]() SLIRaw is a error ratio SLI already calculated. Normally this will be used when the SLI is already calculated by other recording rule, system... @@ -453,7 +453,7 @@ func (in *SLIRaw) DeepCopyInto(out *SLIRaw) DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non\-nil. -## type [SLO]() +## type [SLO]() SLO is the configuration/declaration of the service level objective of a service. @@ -481,6 +481,7 @@ type SLO struct { Labels map[string]string `json:"labels,omitempty"` // Info labels added to the `sloth_slo_info` metric + // +optional InfoLabels map[string]string `json:"infoLabels,omitempty"` // +kubebuilder:validation:Required diff --git a/pkg/kubernetes/api/sloth/v1/types.go b/pkg/kubernetes/api/sloth/v1/types.go index 67983d8a..833f7372 100644 --- a/pkg/kubernetes/api/sloth/v1/types.go +++ b/pkg/kubernetes/api/sloth/v1/types.go @@ -69,6 +69,7 @@ type SLO struct { Labels map[string]string `json:"labels,omitempty"` // Info labels added to the `sloth_slo_info` metric + // +optional InfoLabels map[string]string `json:"infoLabels,omitempty"` // +kubebuilder:validation:Required