Application Insights:筛选网站健康检查?

Application Insights: Filter website health checks?

我使用的是免费层级的 Azure Application Insights。我们还使用亚马逊 AWS 健康检查,它点击了一个 pre-determined 页面,期望 200 响应,如果它得到不同的响应,它就会做一些事情。

来自 AWS 的所有请求都很快填满了遥测数据。

有没有一种简单的方法可以过滤或排除这些请求?

是否可以从 App Insights 控制台完成,或者是否需要修改实际应用程序上的遥测收集器。我宁愿不创建自己的 ITelemtryProcessor 实现...

如果我坚持走那条路,这能过滤 AWS Route53 检查吗?

public void Process(ITelemetry item)
{
  if (!string.IsNullOrEmpty(item.Context.Operation.SyntheticSource)) {return;}
  this.Next.Process(item);
}

Edit-Update

有没有人看过applicationinsights.config的这一部分我不确定这意味着它不会有相关性headers。

 <ExcludeComponentCorrelationHttpHeadersOnDomains>
    <!-- 
    Requests to the following hostnames will not be modified by adding correlation headers. 
    This is only applicable if Profiler is installed via either StatusMonitor or Azure Extension.
    Add entries here to exclude additional hostnames.
    NOTE: this configuration will be lost upon NuGet upgrade.
    -->
    <Add>core.windows.net</Add>
    <Add>core.chinacloudapi.cn</Add>
    <Add>core.cloudapi.de</Add>
    <Add>core.usgovcloudapi.net</Add>
    <Add>localhost</Add>
    <Add>127.0.0.1</Add>
  </ExcludeComponentCorrelationHttpHeadersOnDomains>

有没有人有任何其他资源或教程,我能找到的唯一一个:https://docs.microsoft.com/en-us/azure/application-insights/app-insights-api-filtering-sampling#filtering

似乎最简单的实现方式可能是从 web.config 中获取一个 collection,在它自己的 class 文件中定义处理器,然后将处理器插入到链入全局配置...

您必须像上面那样编写遥测初始化程序。

但是,您可能希望更具体地查看合成源并验证内容,只丢弃亚马逊健康检查而不是所有合成流量(您还可以查看请求名称等来做出决定),因为我不确定来自亚马逊的入站请求中包含哪些信息。

否则,您可能会丢弃网络测试中可能出现的传入 requests/dependencies/exceptions,这也会显示为合成。