-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat(alerts): add support for ignoreOnExpectedTermination
in expiration
to NRQL alert conditions
#1180
feat(alerts): add support for ignoreOnExpectedTermination
in expiration
to NRQL alert conditions
#1180
Conversation
@@ -712,3 +484,240 @@ func TestIntegrationNrqlConditions_StreamingMethods(t *testing.T) { | |||
} | |||
}() | |||
} | |||
|
|||
func TestIntegrationNrqlConditions_IgnoreOnExpectedTermination(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New test
return baseCondition | ||
} | ||
|
||
func nrqlUpdateFactory(args ConditionArgs) NrqlConditionUpdateBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just doing some go experimenting/clean up here to create factory functions
2fcb04c
to
54631ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I just had a couple nits
pkg/alerts/nrql_conditions.go
Outdated
@@ -731,6 +732,7 @@ const ( | |||
closeViolationsOnExpiration | |||
expirationDuration | |||
openViolationOnExpiration | |||
ignoreOnExpectedTermination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this indentation weird or is it just on my screen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, it seemed to me like this was actually unindented in the code, which is why I tried fixing it; and it turns out it actually is something weird with GitHub. Apologies, please ignore my latest commit 38a14d7
(here's what it looks like after the indent was fixed, but GitHub's diff still shows an extra indent).
policy, err := client.CreatePolicyMutation(testAccountID, testPolicy) | ||
require.NoError(t, err) | ||
|
||
// Test: Create (static condition with streaming methods fields) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Update comment to `Test: Create (static condition with expected termination field)
2ba6115
to
2c3b154
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1180 +/- ##
==========================================
- Coverage 38.84% 38.40% -0.44%
==========================================
Files 86 96 +10
Lines 5612 4822 -790
==========================================
- Hits 2180 1852 -328
+ Misses 3266 2795 -471
- Partials 166 175 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ignoreOnExpectedTermination
to queries and mutations dealing in baseline NRQL alert conditions
chore(alerts): fix indentation of the newly added ignoreOnExpectedTermination field
38a14d7
to
cdaf36b
Compare
ignoreOnExpectedTermination
to queries and mutations dealing in baseline NRQL alert conditionsignoreOnExpectedTermination
to NRQL alert conditions
ignoreOnExpectedTermination
to NRQL alert conditionsignoreOnExpectedTermination
in expiration
to NRQL alert conditions
Summary
https://new-relic.atlassian.net/browse/NR-270141
This PR includes changes to support the usage of a new field with baseline/static NRQL alert conditions,
ignoreOnExpectedTermination
. This field is expected to be live on production soon, in queries and mutations which manage baseline/static NRQL alert conditions (theexpiration
field in these queries and mutations has been updated to containignoreOnExpectedTermination
). Examples of some of these mutations and queries have been depicted below.PR with Terraform Provider changes
newrelic/terraform-provider-newrelic#2700