HàPhan 河

Some useful Newrelic queries for mobile app (NRQL)

If you read this article you may know about https://newrelic.com.
It's powerful tool to monitor your system performance, from Frontend to Backend or database.

To prepare for new version release, we need to monitor status of our latest app to find issues that can not detected in testing phase, and can react to incident faster.

Below are some queries that i'm using...

  1. App Launches - how many device launched your current version
FROM MobileSession SELECT uniqueCount(deviceUuid) FACET appVersion WHERE appVersion = '9.9.9' AND appName = 'sample-ios-app' TIMESERIES AUTO SINCE '2022-08-31 00:00:00'
  1. Upgraded From - which app version is upgraded to your newest version
FROM MobileSession SELECT count(upgradeFrom) WHERE appVersion = '9.9.9' AND appName = 'sample-ios-app' FACET upgradeFrom TIMESERIES AUTO SINCE last week
  1. Crash Count and crash ratio
FROM MobileCrash SELECT count(*)  AS 'Crash Count' WHERE appVersion = '9.9.9' AND appName = 'sample-ios-app' TIMESERIES AUTO SINCE 1 day ago
FROM MobileSession, MobileCrash SELECT percentage(uniqueCount(sessionId), WHERE category = 'Crash') AS `Crash Rate` WHERE appVersion = '9.9.9' AND appName = 'sample-ios-app' TIMESERIES AUTO SINCE 1 day ago
  1. Crashes by all Versions
FROM MobileCrash SELECT count(*) WHERE appName = 'sample-ios-app' WHERE crashFingerprint NOT IN () FACET `appVersion` TIMESERIES SINCE '2022-08-31 00:00:00'
FROM MobileSession, MobileCrash SELECT percentage(uniqueCount(sessionId), WHERE category = 'Crash')  WHERE appName = 'sample-ios-app' FACET `appVersion` TIMESERIES SINCE '2022-08-31 00:00:00'
  1. App Launches - all versions
FROM MobileSession SELECT uniqueCount(deviceUuid) FACET appVersion WHERE appVersion not like '%dirty' AND appName = 'sample-ios-app' TIMESERIES AUTO SINCE this week
  1. UUID by App Versions
FROM Mobile SELECT abs(uniqueCount(deviceUuid)) WHERE appName like 'sample-ios-app' FACET appVersion SINCE this month

Hope those queries can help.

Comments