How to write NRQL for alert based on percentile

Hi Team,

I wanted to know if it is possible to set alert when 99.5 th (percentile) value is > 7s for 15 min window, Could you please NSQL to the same.
Also is it possible to set multi window alert based on error budget burn rate ?

Hi @sudarsks, welcome! Both should definitely be possible; have you had the opportunity to review the following resources?

Those should help you get started writing a query, but let us know if you run into anything unexpected.

@jeffrey_s Thanks for reply…I’m trying to create alert based on following query
SELECT percentile(duration,99.9) FROM Transaction where appName=‘creditsc-web-app-prod’ TIMESERIES
Alert condition: percentile response goes above 10s for 15 minute.
what is observed?: It calculating 99.9 value based for 1 min data & getting false alert.
what is expected ?: We need to have alert when 99.9 percentile value is greater than 10s & consider data for 15 minutes
Could you please let me know how I can resolve this issue?

Hi @sudarsks, as observed, the default aggregation window for a NRQL alert condition is 1 minute.

However, we’ve recently introduced flexible aggregation windows as part of New Relic One Streaming Alerts. By changing the aggregation window to 15 minutes (the maximum value allowed), you should be able to achieve your use case.

Aggregation window settings can be found under Advanced signal settings as indicated below:

If your account has been enabled for Streaming Alerts, this will allow you to alert on a percentile taken in 15-minute blocks rather than individual 1-minute slices.

Be sure to let us know how things go! If things still aren’t working to your expectations, please share a link to the alert condition.