我想加入来自AppInsights浏览器软件开发工具包的pageViews,到后端的请求。我没有看到有意义的外键,有OOTB吗?或者我需要编写一些代码来将它们连接在一起?
为了添加上下文,我对cloudRoleInstance (服务器)的pageView持续时间感兴趣,但cloudRoleInstance仅在请求时可用。
我尝试了以下方法,但不起作用,我假设操作ID不同。
pageViews
| join (requests) on operation_Id发布于 2018-05-12 08:33:37
支持按操作ID (operation_Id)加入。
以下是返回特定operation_Id的所有文档的查询:
union *
| where timestamp > ago(1d)
| where operation_Id == "<operation_id>"

发布于 2020-01-17 23:47:05
我对完全相同的事情感兴趣,这就是我最终解决它的方式:
*我之所以这样做,而不是像另一个答案所说的那样加入operationId,是因为operationId似乎跨越了服务器上的许多请求,有时是在半小时的过程中。也许这是因为我们的单页应用程序的设置方式,但operationId就是不适合我。
代码
BaseController.cs::BeginExecute (我们有自己的BaseController,所有其他控制器都继承它)
var roleInstanceCookie = requestContext.HttpContext.Response.Cookies.Get("cloud_RoleInstance");
roleInstanceCookie.Value = Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CurrentRoleInstance.Id;
requestContext.HttpContext.Response.Cookies.Set(roleInstanceCookie);ApplicationInsights.js (这包含加载AI的AI片段,当前使用的是2.3.1版本的JS SDK)
// ... initialization snippet ...
appInsights.addTelemetryInitializer((envelope) => {
envelope.data.cloud_RoleInstance = getCookie("cloud_RoleInstance");
});然后,该cloud_RoleInstance将显示在应用程序洞察中PageViews的customDimensions列中

https://stackoverflow.com/questions/50299085
复制相似问题