How to export app insights with Total Requests and Error Rate in % along with Mobile Request Errors
Are you looking to write a single query that counts total requests, error rate percentage, and lists the error types?
Or would like to export the data you’ve queried in Insights into a separate file?
You can take a look at the queries we use for charts in the Http Requests or Http Errors tabs by clicking the three dots next to a chart and selecting
view query. This will show examples for querying percentages and rate counts.
If you want to save your query results, those can be downloaded into a .csv table or JSON file located above the query results in Insights.
I want to export all data not only Error request count but also total request at least. Percentages % can be calculated using formula in excel.
Right now i am using 2 different queries. 1 query gives me error requests count and 2nd query gives totalRequest count with requests which did not encounter any error they are also displayed. To share report with managers it takes extra time.
1st query: SELECT count(*) FROM MobileRequestError WHERE (appId = 000 OR appVersionId = 111) FACET
requestPath WHERE requestDomain = ‘abc’ OR requestDomain = ‘xyz’ SINCE ‘2020-10-01 19:30:00 +0530’ UNTIL ‘2020-10-02 20:00:00 +0530’ LIMIT 1000
2nd query: SELECT count(*) As ‘TotalRequests’ FROM MobileRequestError,MobileRequest WHERE (appId = 000 OR appVersionId = 111) FACET
requestPath WHERE requestDomain = ‘abc’ OR requestDomain = ‘xyz’ SINCE ‘2020-09-25 19:00:00 +0530’ UNTIL ‘2020-09-26 19:00:00 +0530’ LIMIT 1000
Please suggest if I can get it on single query.
Hi @sayrina.lopes-v, I definitely think this would be possible within a single query.
Along with a simple
count(*) to return a count of events from both event types, you’ll probably want to use the
filter( ) function in coordination with
eventType( ) in order to return an additional count that’s filtered down to the count of events from a single event type.
We have an example of something similar in our documentation here. Let me know if that points you in the right direction!
- Actually I need to export a report in 3 columns API NAME, Error Request(MobileRequestError), Total Request (i.e. MobileRequestError,MobileRequest) for different request domain also this should not include .jpg,.png,.gif,.jpeg also if i can get report in descending order of total request(not only errors)
Note: if there were no failures then we can list api name with 0 or null for that api with total requests (it will be great if we can filter :not to display api which doesn’t fail at all)
- It is not possible to take report for 7 days (for ex. 20 Sep -27 Sep )