- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用 REST API 检索 AppInsights 自定义指标并在查询中使用过滤器。
创建指标的代码:
var telemetry = new MetricTelemetry();
telemetry.Context.InstrumentationKey = instrumentationKey;
telemetry.Name = FacebookFupMetricName;
telemetry.Value = amount;
telemetry.Timestamp = DateTime.Now;
telemetry.Properties["agencyCode"] = agencyCode;
telemetry.Properties["accountCode"] = accountCode;
telemetry.Properties["category"] = category;
telemetry.Properties["action"] = action;
var client = new TelemetryClient();
client.TrackMetric(telemetry);
client.Flush();
运行此代码时,该指标是在 Azure 中创建的。
现在我想使用 REST API 来检索指标并在查询中使用过滤器。当我使用过滤器时
category eq 'cat001'
查询以错误结束
The following dimensions are not valid in the filter clause for this metric: category
查询网址为:
https://dev.applicationinsights.io/apiexplorer/metrics?appId=<appId>&apiKey=<apiKey>&metricId=customMetrics%2FFacebookFupAction×pan=P1D&aggregation=sum&filter=category%20eq%20%27cat001%27
问题是,是否可以使用维度过滤自定义指标?
最佳答案
在过滤器字段中,您应该使用customDimensions/category eq 'cat001'
。
生成的url格式如下:
`https://dev.applicationinsights.io/apiexplorer/metrics?appId=<appId>&apiKey=<apiKey>&metricId=customMetrics%2FFacebookFupMetricName&aggregation=sum&filter=customDimensions%2Fcategory%20eq%20'cat001'`
截图如下:
关于c# - 如何使用 REST API 筛选 AppInsights 自定义指标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58415335/
我在 .NET CORE 2.0 项目上使用 Serilog 和 appinsights 编写日志。 我已经按如下方式配置了 SeriLog, var loggerConfiguration = ne
目前,我正在将自定义日志消息记录到 Azure 表中。 现在我需要根据日志类型自动触发发送电子邮件,还需要根据日志消息生成分析报告。 哪种服务更适合完成此任务? Azure Application I
我们正在考虑为我们的非 Web 应用程序实现 AppInsights。我们想要监视的事情之一是可能“挂起”超过 N 秒或分钟的进程。我一直找不到内置的东西可以做到这一点。我见过或想到的最接近的事情是记
背景 我有一个 Azure“应用服务”资源和一个链接的“Application Insights”资源。它们通过应用程序服务的 Settings -> Applications settings ->
我已将 Azure 应用程序洞察配置到我的 Web 应用程序。我添加了如下代码。 catch (Exception serverEx) {
我们正在使用“Microsoft.ApplicationInsights 2.1.0.0”并安装了 appinsight block 包。已经配置的应用程序。我可以看到页面 View 、服务器请求和失
我的系统的一些常规设置: Windows x64 .net 3.1 AspNet.Core Serilog + AppInsights 编写器 最近,我们开始观察许多如下所示的跟踪日志。我认为当我们尝
有没有办法控制发送到 AppInsights 跟踪的数据。正如官方文档所述,过滤和预处理是可行的方法。我无法从 POST 和 PUT 中获取属性(密码)。由于密码很敏感,我不想被发送到 App Ins
我正在努力创建 AppInsight 查询... 我想获取应用程序启动的次数,并将其除以触发特定事件的次数(拼写检查器)。 实际上,我有 3 个应用程序,它们都使用相同的拼写检查功能,我想看看每个应用
如何制作包含单个指标的单个图 block 1x1? 仪表板附带的一些默认图 block 显示单个指标,例如用户计数。我如何制作自己的指标? 例如,异常(exception)情况的数量? 类似这样的吗?
我的 kusto 查询有问题。此 kusto 查询在警报调用内运行。我尝试通过电子邮件向我们的客户发送通知。 场景: 我尝试在周六上午 7 点到 13 点之间发送消息。 (仅限周六)但周日我也会收到消
在 Asp.net Core 版本 3.1 中,我尝试将 LogInformation 记录到 Application Insights,但它没有登录到 App Insight。 private re
我一直在尝试使用 Log4Net 而不是默认的 api 遥测客户端在 Azure AppInsights 中写入日志(跟踪、信息和异常)。当我从 VS2013 运行应用程序时,我既没有收到任何错误消息
我有一个由 3 个网络项目组成的解决方案: 1 - MVC应用程序用作 auth/STS 2 - Web Api 2应用程序 3 - MVC app(主站点)用于加载 Angular 应用程序。 我已
我们已经在 Azure 中配置了 APIM、WebApp,然后连接了 AppInsights Log 以在出现故障时获取详细信息。 我们正在 APIM 上进行负载测试。 有一次,我们开始收到 500
我的 kusto 查询有问题。此 kusto 查询在警报调用内运行。我尝试通过电子邮件向我们的客户发送通知。 场景: 我尝试在周六上午 7 点到 13 点之间发送消息。 (仅限周六)但周日我也会收到消
在 Asp.net Core 版本 3.1 中,我尝试将 LogInformation 记录到 Application Insights,但它没有登录到 App Insight。 private re
我一直在尝试使用 Log4Net 而不是默认的 api 遥测客户端在 Azure AppInsights 中写入日志(跟踪、信息和异常)。当我从 VS2013 运行应用程序时,我既没有收到任何错误消息
我有一个由 3 个网络项目组成的解决方案: 1 - MVC应用程序用作 auth/STS 2 - Web Api 2应用程序 3 - MVC app(主站点)用于加载 Angular 应用程序。 我已
我们已经在 Azure 中配置了 APIM、WebApp,然后连接了 AppInsights Log 以在出现故障时获取详细信息。 我们正在 APIM 上进行负载测试。 有一次,我们开始收到 500
我是一名优秀的程序员,十分优秀!