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

Resource newrelic_nrql_alert_condition: Allow SINCE on query #2782

Closed
DFurt opened this issue Dec 13, 2024 · 1 comment
Closed

Resource newrelic_nrql_alert_condition: Allow SINCE on query #2782

DFurt opened this issue Dec 13, 2024 · 1 comment
Assignees

Comments

@DFurt
Copy link

DFurt commented Dec 13, 2024

Feature Description

I'm trying to set an alert condition for when the synthetics checks reach a certain limit per month, but can't use SINCE in the query like this:

  query = "SELECT (sum(syntheticsFailedCheckCount) + sum(syntheticsSuccessCheckCount)) AS 'Total Checks' FROM NrDailyUsage WHERE syntheticsTypeLabel != 'Ping' SINCE this month"

as SINCE isn't valid input:

 Error: Validation Error: BAD_USER_INPUT

 nrql.query: NRQL query must not contain [SINCE] keyword(s)

Describe Alternatives

Considered aggregation_window but isn't valid also, because currently the maximum is 6hours and also because i'd want the counting to be from the start of each month. Even if the aggregation window was increased, it's not set by a date, but by time from now.

@vinay-newrelic
Copy link
Contributor

vinay-newrelic commented Dec 19, 2024

Hii @DFurt there are few reasons for the restricted usage of SINCE in nrql alert condition query - here's what our Alerts team at New Relic has to say (we reached out to them to double check if it was an actual design decision to not support SINCE in alert conditions)

The restriction on using the SINCE keyword in NRQL alert conditions because alerts need to evaluate data based on fixed aggregation windows instead of dynamic time ranges and we engineered the conditions to trigger based on the things set in the "thresholds" section and if you were to try to have a "since" clause and a "threshold" set, there may be some weird outcomes. e.g. "since 1 hour ago" 1 hour ago from when? from when you enable it? from when you create it? we'd have to track these things and thats just not how it was created to work.

Hope this clarifies

@pranav-new-relic pranav-new-relic changed the title Allow SINCE on newrelic_nrql_alert_condition query Resource newrelic_nrql_alert_condition: Allow SINCE on query Jan 2, 2025
@pranav-new-relic pranav-new-relic closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants