-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(osko) Too many changes to summarize (#33)
* feat(ds): multiple changes in datasource controller - add EventRecorder - new function for datasource connection validation * feat(mimirtool): functional PoC for mimir rules - PrometheusRule controller is able to reconcile and create rules in Mimir * chore(ratio): ratio rule function optimizations - minimize code repetition - use constants for strings that appear more than once - early return of an error * feat(osko): So many changes, not able to summarize - move apis from `apis` folder to the `api` folder, since it is more kubebuilder compliant - add MimirRule type and controller - create helpers package - move fuctions responsible for creating the mimir rules and some Prometheus rules into helpers package - add somehow updated high level dependency graph to DESIGN document - remove obsolete and unused crds * fix(ci): change apis to api in Dockerfile * feat(mimir): add MimirRule type - some other changes in rule creation flow - fix missing tags in osko_slo_target record rule - other changes and fixes (hard to track the mess) * feat(osko): Another batch of undescribeable changes - remove mimirtool package and moved all function into mimirtool helper - add debug and pretty output run to Makefile - changes in MimirRule types - fix error_budget_rule logic Signed-off-by: Hy3n4 <hy3nk4@gmail.com>
- Loading branch information
Showing
48 changed files
with
1,693 additions
and
931 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
apis/openslo/v1/datasource_types.go → api/openslo/v1/datasource_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apis/openslo/v1/zz_generated.deepcopy.go → api/openslo/v1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
"github.com/prometheus/common/model" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// MimirRuleSpec defines the desired state of MimirRule | ||
type MimirRuleSpec struct { | ||
// Groups is an example field of MimirRule. Edit mimirrule_types.go to remove/update | ||
Groups []RuleGroup `json:"groups"` | ||
} | ||
|
||
// MimirRuleStatus defines the observed state of MimirRule | ||
type MimirRuleStatus struct { | ||
Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
LastEvaluationTime metav1.Time `json:"lastEvaluationTime,omitempty"` | ||
Ready string `json:"ready,omitempty"` | ||
} | ||
|
||
type RuleGroup struct { | ||
Name string `json:"name"` | ||
SourceTenants []string `json:"source_tenants,omitempty"` | ||
Rules []Rule `json:"rules"` | ||
Interval model.Duration `json:"interval,omitempty"` | ||
EvaluationDelay *model.Duration `json:"evaluation_delay,omitempty"` | ||
Limit int `json:"limit,omitempty"` | ||
AlignEvaluationTimeOnInterval bool `json:"align_evaluation_time_on_interval,omitempty"` | ||
} | ||
|
||
type Rule struct { | ||
Record string `json:"record,omitempty"` | ||
Alert string `json:"alert,omitempty"` | ||
Expr string `json:"expr"` | ||
For model.Duration `json:"for,omitempty"` | ||
KeepFiringFor model.Duration `json:"keep_firing_for,omitempty"` | ||
Labels map[string]string `json:"labels,omitempty"` | ||
Annotations map[string]string `json:"annotations,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:printcolumn:name="Ready",type=string,JSONPath=.status.ready,description="The reason for the current status of the MimirRule resource" | ||
//+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` | ||
|
||
// MimirRule is the Schema for the mimirrules API | ||
type MimirRule struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec MimirRuleSpec `json:"spec,omitempty"` | ||
Status MimirRuleStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// MimirRuleList contains a list of MimirRule | ||
type MimirRuleList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []MimirRule `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&MimirRule{}, &MimirRuleList{}) | ||
} |
Oops, something went wrong.