181870043
181870043

Reputation: 21

How to develop NRQL alert when 200 status rate < 95% base on this pie

I am a new user for NewRelic, now I can develop NRQL to query some data:

SELECT count(http.server.request.duration) 
FROM Metric 
WHERE stage = 'production' 
  AND url.full = '/AAAAAAA/BBBBBBBB'
  AND http.request.method = 'GET' 
FACET http.response.status_code

and can get the pie graph below: enter image description here

In fact, I hope to trigger a alert when 200 status rate < 95% Could somebody know how to amend above NRQL to caculate 200 status rate?

Thanks

I have made some test to amend this QL but failed.

Upvotes: 0

Views: 51

Answers (1)

181870043
181870043

Reputation: 21

After asked NewRelic AI,the below NRQL can work well:

SELECT percentage(
  count(`http.server.request.duration`), 
  WHERE `http.response.status_code` = '200') 
FROM Metric 
WHERE stage = 'production' 
  AND `url.full` = 'AAAA/BBBBB' 
  AND `http.request.method` = 'GET'

then set the threshold below 95% can trigger the alert.

Upvotes: 0

Related Questions