Derivatives function

Hello, I want to get sudden change in the logs for last 5 minutes for 2xx response codes and then create alert on this; for this I am writing this query using derivative, can anyone let me know if anything is wrong here?
SELECT derivative(requests, 5 minutes) FROM (SELECT COUNT(*) as requests FROM TRANSACTION WHERE httpResponseCode >= ‘200’ AND httpResponseCode < ‘300’) WHERE appName = ‘app-Name’

Hey @dishant.patel,

This might be possible, but I haven’t seen this particular use case before. The NRQL looks syntactically correct, but I don’t have a test app with data reporting that returns a result from that query.

I believe a NRQL Baseline might be a better choice for monitoring sharp deviations away from a steady data set. Here’s a doc about this: Create baseline alert conditions | New Relic Documentation

Let us know if you have any questions about this.


1 Like