Greetings everyone, yesterday I encountered a bug/feature with a certain query in NR. I have the following queries for mobile requests:
SELECT count(*) as 'Total Mobile Requests', percentage(count(*), WHERE statusCode = 500) as `% 500 errors` ,
percentile((responseTime or 0),95) as 'p' FROM MobileRequestError ,MobileRequest WHERE appName ='some-app-name'
FACET requestPath, requestMethod, requestDomain as 'Service' SINCE 1 hour ago LIMIT MAX
SELECT count(*) as 'Total Mobile Requests', percentage(count(*), WHERE StatusCode = 500) as `% 500 errors` ,
percentile((responseTime or 0),95) as 'p' FROM MobileRequestError, MobileRequest WHERE appName='some-app-name'
FACET requestPath, requestMethod, requestDomain as 'Service' SINCE 1 hour ago LIMIT MAX
At first glance they seem identical, but they don’t have the same table as output. The first one works fine, it does what it’s intended to do. The second one, even though it looks identical, doesn’t return the expected output( the % of 500 errors for every path). The problem in the second query is the comma at "FROM MobileRequestError, MobileRequest"
. It works fine if the comma is like this - "FROM MobileRequestError ,MobileRequest"
. Not sure why this happens, not sure that the comma is making this not work properly, but when I changed it it started working as intended. I don’t know if this is expected behaviour so I decided to report it.