2016-01-06 45 views
4

我们记录的约50%的数据点是“依赖关系(AJAX)”。“应用程序洞察”中的“依赖关系(AJAX)”

这是从哪里来的?

我认为这些“依赖(AJAX)”在我的web应用程序的应用程序设置(我们使用signalr)中启用Web套接字后开始显示。

这些数据点的属性“命令”具有“/ signalr/ping”的值,所以这肯定与signalr有关。

我想排除这些,因为它使用了太多的免费计划可用数据点。

我的ApplicationInsights.config中已经禁用了Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule。

编辑

我尝试禁用网络插座,但仍然获得这些日志。

编辑2016年2月24日

至于建议由Alex,我设置disableAjaxTracking:没错,但是这并没有帮助。

以下是我的html的<head>中的appInsights代码。

<script type="text/javascript"> 
    var appInsights = window.appInsights || function (config) { 
     function r(config) { t[config] = function() { var i = arguments; t.queue.push(function() { t[config].apply(t, i) }) } } var t = { config: config }, u = document, e = window, o = "script", s = u.createElement(o), i, f; for (s.src = config.url || "//az416426.vo.msecnd.net/scripts/a/ai.0.js", u.getElementsByTagName(o)[0].parentNode.appendChild(s), t.cookie = u.cookie, t.queue = [], i = ["Event", "Exception", "Metric", "PageView", "Trace"]; i.length;) r("track" + i.pop()); return r("setAuthenticatedUserContext"), r("clearAuthenticatedUserContext"), config.disableExceptionTracking || (i = "onerror", r("_" + i), f = e[i], e[i] = function (config, r, u, e, o) { var s = f && f(config, r, u, e, o); return s !== !0 && t["_" + i](config, r, u, e, o), s }), t 
    }({ 
     instrumentationKey: "@Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey", 
     disableAjaxTracking: true 
    }); 
    window.appInsights = appInsights; 
    appInsights.trackPageView(); 
</script> 
@if (Request.IsAuthenticated) 
{ 
    <script> 
     appInsights.setAuthenticatedUserContext("@User.Identity.Name".replace(/[,;=| ]+/g, "_")); 
    </script> 
} 
+0

我们目前在这里遇到同样的问题,因为SignalR的ping产生的530万个依赖数据点导致免费层被破坏。如果我在我的网站上发现了某些内容,我会继续发帖。 –

回答

2

从2015年12月底开始Application Insights JavaScript SDK自动收集AJAX请求。这是一个blog post about it。 自启用以来,我们还引入了可以在每个页面视图中记录的最大AJAX请求上限,默认值为500,但您可以通过将此属性添加到代码段来更改此设置(有关此博客和链接文档的更多内容) :

您也可以禁用产品总数AJAX请求收集使用此设置:

disableAjaxTracking: true 

编辑:看起来像disableAjaxTracking被打破截至2016年2月24日,直到它是固定的,在缓解就是用

maxAjaxCallsPerView: 0 
+0

我尝试设置disableAjaxTracking:true,但仍然看到所有这些“依赖(AJAX)” –

+0

您的网站是否有面向公众的URL,因此我们可以尝试诊断是否仍在收集Ajax? –

+0

没有抱歉,该网站需要身份验证,并且登录页面没有appInsights集成。如果有帮助,我确实使用javascript appInsights代码更新了我的问题。 –