Skip to content

Commit

Permalink
Add support for drop_nan_value in Drop Rule resource
Browse files Browse the repository at this point in the history
drop_nan_value allows you to drops datapoints if the datapoint
values are NaN. This change adds support for that field.
  • Loading branch information
aschepis committed Apr 3, 2024
1 parent 2d5edd4 commit 5b1d11b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions chronosphere/intschema/drop_rule.go

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

2 changes: 2 additions & 0 deletions chronosphere/resource_drop_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (dropRuleConverter) toModel(
Mode: dropRuleModeToModel(r.Active),
Filters: filter,
ConditionalRateBasedDrop: conditionalRateBasedDrop,
DropNanValue: r.DropNanValue,
ValueBasedDrop: valueBaseDropToModel(r.ValueBasedDrop),
}, nil
}
Expand All @@ -87,6 +88,7 @@ func (dropRuleConverter) fromModel(
Slug: m.Slug,
Active: m.Mode == models.Configv1DropRuleModeENABLED,
Query: aggregationfilter.ListFromModel(m.Filters, aggregationfilter.DropRuleDelimiter),
DropNanValue: m.DropNanValue,
ValueBasedDrop: valueBasedDropFromModel(m.ValueBasedDrop),
}
if m.ConditionalRateBasedDrop != nil {
Expand Down
4 changes: 4 additions & 0 deletions chronosphere/tfschema/drop_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ var DropRule = map[string]*schema.Schema{
Type: schema.TypeBool,
Optional: true,
},
"drop_nan_value": {
Type: schema.TypeBool,
Optional: true,
},
"activated_drop_duration": Duration{
Optional: true,
}.Schema(),
Expand Down

0 comments on commit 5b1d11b

Please sign in to comment.