Regarding custom metrics application insights - azure-application-insights

I have a scenario where I'm getting custom metrics thru an application. I want to create alerts based on thresholds and days of the week. Is there any way I can integrate the metadata in some storage and compare the metrics based on that? For example, I have message count metrics in the application, and if on Monday the message count is less than 100 or more than 200 I should get an alert. It varies on the day of the week. I have to monitor almost 250 custom metrics.
I tried implementing custom logs in Log analytics but I have a challenge in case if I want to change the thresholds then I need to drop the custom table and recreate it.

Thank you AnuragSingh-MSFT | Microsoft Docs. Posting your suggestion as an answer to help other community members.
Using a combination of both dayofweek() and case() functions, the resultant query itself can contain the threshold based on the day-of-week. Therefore, in future if the threshold changes, you will only have to edit the case statement and this solution also does not require additional storage/custom table.
let day = dayofweek(now());
let threshold = case(day == 1d, 5m, //threshold for Monday is 5 minutes
day == 2d, 2m, //threshold for Tuesday is 2 minutes
day == 3d, 5s, //threshold for Wednesday is 5 seconds
10m); //threshold for any other day is 10 minutes.
Heartbeat
| summarize LastHeartbeat=max(TimeGenerated) by Computer
| where LastHeartbeat < ago(threshold)
Reference: Regarding custom metrics application insights - Microsoft Q&A

Related

How to produce a histogram in Google Data Studio from Google Analytics

For a game I've written, we have certain analytics events. These go to Firebase/Google Analytics. I'm trying to visualise these in Google Data Studio without needing to write things in BigQuery. It feels like it should be possible, but the report isn't working.
Specifically: I have a custom event "level_completed" and that has a parameter of "time_taken" to record how long the player took to complete that level. This is captured in milliseconds.
I'd like to produce a histogram / distribution / heatmap / almost any visualisation to show me:
How long did people take to complete the level? I'd expect the underlying data to look like:
Minutes into the game
Number of users who completed the level at that duration
0
5
1
10
2
22
3
8
4
3
5
1
6
0
7
1
The custom event property is configured in Google Analytics as a "custom metric" (as GA advises that it shouldn't be a custom dimension if it has lots of possible different values.
When I connect this to Google Data Studio, using the Google Analytics connector, the data is visible as a metric, but not as a dimension.
I tried to turn it into some bins using the calculated field example in Calculating and displaying customer lifetime value histogram with BigQuery and Data Studio, but what I end up with is a table that just contains a single row which looks to be the sum or average of minutes into the game, and I can't get it to count the unique users by each minute-into-the-game value.
I would be grateful for anyone's guidance.

Multi-Channel Funnels response per day not total

I'm doing this request in Python / Postman:
https://www.googleapis.com/analytics/v3/data/mcf?
ids=ga:xxxx&metrics=
mcf:assistedConversions&
dimensions=&
start-date=2011-10-01&
end-date=2011-10-31
But I only seem to be able to get the total number of results.
1/ Can I get it on a daily granularity? I know that GA API has the ga:date optional parameter, but this does not work in combination with the MCF API and I couldn't find anything similar for MCF.
Do I have to iterate through each day to get the results at a daily granularity?
2/ Is the 30 days lookback applied to API calls? If just put the end date 4 years ahead, will it give me the full results?
Daily granularity: You should add the mcf:nthDay dimension to break the results down into individual days within the specified range:
Index for each day in the specified date range. Index for the first
day (i.e., start-date) in the date range is 0, 1 for the second day,
and so on.
Loopback time: yes it's 30 days and can'be be changed:
Note: The Multi-Channel Funnels Reporting API uses a non-adjustable
30-day lookback window.
If just put the end date 4 years ahead, will it give me the full results?
Why don't you test to find out and let us know :) ?

Application insight

I have created a powerBI dashboard for my application insight but it's only showing last 7 days data.
I am able see 30 days when I check in overview of appinsight but it's only showing last 7 days when I do browser search from overview view.
I'm not sure how you are exporting you Application Insights telemetry to PowerBI, but you can export the data using Application Insights Analytics queries. This way, you have full control on the timestamp range in the Analytics query.
For example, for finding the average request duration in the last 30 days in a daily bin, you can use the following query:
request
| where timestamp >= ago(30d)
| summarize avg(duration) by bin(timestamp, 1d)
Asaf

Using enhanced e-commerce (GA) how long does it take Google Analytics to aggregate data?

Before Tuesday, March 14th, we saw the data lag in Google Analytics at approximately 1-2 hours. (It was never immediate.) You can see this effect on the Conversions > Ecommerce > Overview page if you search by date and select "today" to "today" (1 day's worth of data)
As of Tuesday, March 14th, we started seeing the lag for this overview report anywhere from 8-12 hours, with an inconsistent aggregation time. For example, it is now 4 PM here on the east coast (EDT), and here is a screenshot of our GA overview tab (I have obscured the revenue number for our privacy). As you can see, there are no numbers after 6:00 AM.
We saw this same effect yesterday (about 8-10 hour lag), and the following day the overview report seemed to fix itself (catch up with all of the aggregated data).
Now, what's more interesting, is that if we either A) Add a "Secondary Dimension" or B) use a "Custom Report", we can see all our data near real-time. For example, if I switch into the Ecommerce > Sales Performance report, then add a Secondary Dimension of "Hour of Day", I can see all my data through 2 PM today (about a 2 hour lag as it is now 4:22 pm as I am writing this)
[
Note that to replicate this I sorted the "Hour by day" column by descending order (showing most recent first.)
Our questions are:
(1) Does anyone know why searching by Secondary Dimension or Custom Report shows us the data in more real-time than just looking at the overview report?
(2) Can anyone else confirm that what used to be a 2-3 hour delay now appears as if it is a 8-12 hour delay, starting on or around March 14th (possibly a few days earlier, this is the first day we can remember seeing this effect)
We are using Universal Analytics (with Enhanced E-commerce) implemented via the newer analytics.js. We are NOT using the older ga.js (we moved away from that about a year ago.)
We are not a GA 360 customer, just a regular free account.
From Google Analytics Help Center article.
Processing latency is 24-48 hours. Standard accounts that send more than 200,000 sessions per day to Analytics will result in the reports being refreshed only once a day. This can delay updates to reports and metrics for up to two days. To restore intra-day processing, reduce the number of sessions your account sends to < 200,000 per day. For Analytics 360 accounts, this limit is extended to 2 billion hits per month.
What it means is that for Standard accounts up to 48h delay is normal, if you have more data it can take more if you have less data it can be faster.
Regarding your observation that certain reports load faster than others this is linked to the design of Google Analytics Backends. Google will generate pre-aggregated tables with common reports to speed up consult and that sometimes can takes longer to process. Other non-common reports can't be answered by aggregated reports so it can be responded by a different backend that already has fresher data. So it is considered normal to see different levels of freshness in different reports.
Google Analytics 360 has fresher data of course.
This other table from the HC article highlights some of the differences and has more info.

Using the Google Analytics Export API to get a websites trend

i am working on an application that uses the Google Analytics Export API and i am trying to get the "Trend" result that Google shows against each of your site accounts as a percentage
ie UP 35.04% or DOWN 16.02%
How/where do they get this figure and is it available in the API somewhere.
i have tried comparing averages of last month to this month/first week of the period vs last week of the period etc, but i cannot seem to get the same numbers that Google provides.
any ideas?
thanks in advance
Doug
The formula is pretty simple (excluding today's data):
(Visits over the last 30 days - Visits
between 31 and 60 days ago) / (Visits
between 31 and and 60 days ago).
You can see it in action in the interface if you go to the default dashboard, where it shows you the last 30 days, then on the calendar, click "Compare to past" and select the default amount. It'll show you the numbers used for each calculation and the calculations as they appears in that account list.
The API does not, however, expose pre-calculated numbers (for example, they don't compute bounce rate for you; they just give you the pieces for it.)
So, you'd need to do two API requests to get this data. One for ga:visits in the last 30 days, and then one for ga:visits in the 30 days prior.
Then, when you get it, just subtract, divide, and multiply by 100, and you'll have the percent you're looking for.
UPDATE: The striked out part of the answer was true, but is no longer. The newest version of the Google Analytics API does provide access to some pre-calculated values.

Resources