azure - 我可以在 Application Insights 中按 CustomData 聚合事件吗?

标签 azure azure-application-insights telemetry

我正在尝试在 Application Insights 中制作一个图表,以绘制每次调用 API 时由我的 API 执行的特定操作的数量,并按其执行的语言进行分组。我添加了以下遥测事件:

telemetryClient.TrackEvent("Count event", 
            properties:new Dictionary<string, string>(){{"language", language}}, 
            metrics:new Dictionary<string, double>(){ {"messageCount", operationCount } } );

在指标资源管理器中,当我按事件名称进行过滤时,我可以根据需要按语言进行分组。当事件显示为日志条目时,我可以在事件的 CustomData 中看到 operationCount 值,但我无法在图表中显示该值。我只能选择聚合总和,即调用我的 API 的次数:

enter image description here

有什么方法可以制作一个图表,其中操作计数值作为 y 轴,时间作为 x 轴,并按语言划分?

最佳答案

您应该能够使用 Application Insights Analytics 来完成此操作(然后根据需要固定到仪表板)。

下面是按语言划分的面积图,包含 10m 桶:

customEvents
| where timestamp > ago(1d)
| extend language = tostring(customDimensions.language)
| summarize sum(todouble(customMeasurements.messageCount)) by language, bin(timestamp, 10m)
| render areachart 

关于azure - 我可以在 Application Insights 中按 CustomData 聚合事件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49008523/

相关文章:

asp.net - 发布多个网站 WebRole 时构建转换

Azure 应用程序 map 未连接 Application Insight

azure - 如何在 Application Insights 中获取每个功能应用程序的详细信息

Azure 批量插入 : Bad Request Error

azure - 如何绕过 Backup-SqlDatabase 提示输入密码?

azure - 在 Application Insights for Worker Service 应用程序中配置日志级别

c# - Microsoft Application Insights 的性能注意事项?

azure-functions - AddApplicationInsightsTelemetry 在 Azure 函数中无法识别

.net - Azure App Insights 中的 Rest API(后期)可用性测试

c# - 如何在 AAD 中获取下游服务的 token