Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove group-by from promql alert spec #55

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions apis/coralogix/v1alpha1/alert_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2408,9 +2408,6 @@ type PromqlConditions struct {

TimeWindow MetricTimeWindow `json:"timeWindow"`

// +optional
GroupBy []string `json:"groupBy,omitempty"`

// +optional
ReplaceMissingValueWithZero bool `json:"replaceMissingValueWithZero,omitempty"`

Expand All @@ -2431,14 +2428,6 @@ func (in *PromqlConditions) DeepEqual(actualCondition PromqlConditions) (bool, u
}
}

if !utils.SlicesWithUniqueValuesEqual(in.GroupBy, actualCondition.GroupBy) {
return false, utils.Diff{
Name: "GroupBy",
Desired: in.GroupBy,
Actual: actualCondition.GroupBy,
}
}

if in.TimeWindow != actualCondition.TimeWindow {
return false, utils.Diff{
Name: "TimeWindow",
Expand Down
5 changes: 0 additions & 5 deletions apis/coralogix/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions config/crd/bases/coralogix.com_alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ spec:
- More
- Less
type: string
groupBy:
items:
type: string
type: array
manageUndetectedValues:
properties:
autoRetireRatio:
Expand Down Expand Up @@ -1091,10 +1087,6 @@ spec:
- More
- Less
type: string
groupBy:
items:
type: string
type: array
manageUndetectedValues:
properties:
autoRetireRatio:
Expand Down
1 change: 0 additions & 1 deletion controllers/alphacontrollers/alert_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ func flattenPromqlAlert(conditionParams *alerts.ConditionParameters, promqlParam
Threshold: utils.FloatToQuantity(conditionParams.GetThreshold().GetValue()),
SampleThresholdPercentage: int(promqlParams.GetSampleThresholdPercentage().GetValue()),
TimeWindow: coralogixv1alpha1.MetricTimeWindow(alertProtoTimeWindowToSchemaTimeWindow[conditionParams.GetTimeframe()]),
GroupBy: utils.WrappedStringSliceToStringSlice(conditionParams.GetGroupBy()),
ReplaceMissingValueWithZero: promqlParams.GetSwapNullValues().GetValue(),
}

Expand Down
14 changes: 0 additions & 14 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -749,13 +749,6 @@ AlertSpec defines the desired state of Alert
<i>Enum</i>: Minute, FiveMinutes, TenMinutes, FifteenMinutes, TwentyMinutes, ThirtyMinutes, Hour, TwoHours, FourHours, SixHours, TwelveHours, TwentyFourHours<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>groupBy</b></td>
<td>[]string</td>
<td>
<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#alertspecalerttypemetricpromqlconditionsmanageundetectedvalues">manageUndetectedValues</a></b></td>
<td>object</td>
Expand Down Expand Up @@ -3015,13 +3008,6 @@ AlertStatus defines the observed state of Alert
<i>Enum</i>: Minute, FiveMinutes, TenMinutes, FifteenMinutes, TwentyMinutes, ThirtyMinutes, Hour, TwoHours, FourHours, SixHours, TwelveHours, TwentyFourHours<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>groupBy</b></td>
<td>[]string</td>
<td>
<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#alertstatusalerttypemetricpromqlconditionsmanageundetectedvalues">manageUndetectedValues</a></b></td>
<td>object</td>
Expand Down
Loading