Skip to content

Commit

Permalink
patch - remove group-by from promql alert spec (#55)
Browse files Browse the repository at this point in the history
* patch - remove group-by from promql spec
  • Loading branch information
OrNovo authored Aug 22, 2023
1 parent d77a8e1 commit 9ad7c19
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 39 deletions.
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

0 comments on commit 9ad7c19

Please sign in to comment.