如果可能的话...
目标:查看我的Azure Web应用程序中每个页面具有的视图数量的报告,并包括已获得零视图的页面
当前我已设法在Azure Application Insights中创建的页面视图报告(基于默认报告,显示所有具有> = 1视图的页面。我想在该视图中包含具有0个视图的页面。
这是我在日志中使用的查询的基本版本:
pageViews
| where timestamp between(datetime("2020-03-06T00:00:00.000Z")..datetime("2020-06-06T00:00:00.000Z"))
| summarize Ocurrences=count() by tostring(url)
这些页面在Azure Web应用程序中。
有人知道使用该方法还是其他我没有想到的方法来完成此任务?谢谢您的帮助。
如果页面的视图为零,则意味着没有“页面视图”遥测数据被发送到应用程序见解。因此,应用程序洞察力将不会收集这些零查看的页面URL。
如果要在报表中添加这些零查看的页面,则应在查询中对这些零查看的页面URL进行硬编码。
这里是一个示例,我使用datatable operator和union operator:
//use thie query to add the zero-viewd page url in this datatable
let query1=datatable (url:string,Ocurrences:long)
[
"https://localhost:44364/home/url1",0,
"https://localhost:44364/home/url2",0,
"https://localhost:44364/home/url3",0,
];
//use the query below for non-zero-viewd page
let query2=pageViews
| summarize Ocurrences=count() by tostring(url);
//union the 2 queries
union withsource=TableName query1,query2 | project url,Ocurrences
这里是测试结果: