【发布时间】:2016-02-25 00:14:08
【问题描述】:
我们记录的大约 50% 的数据点是“依赖关系 (AJAX)”。
这是从哪里来的?
我认为这些“依赖项 (AJAX)”是在我的 Web 应用程序的应用程序设置中启用 Web 套接字后开始出现的(我们正在使用信号器)。
这些数据点的属性“Command”的值为“/signalr/ping”,所以这肯定与signalr有关。
我想排除这些,因为它使用了太多我的免费计划可用数据点。
Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule 已在我的 ApplicationInsights.config 中禁用。
编辑
我尝试禁用 Web 套接字,但仍然收到这些日志。
编辑 2016-02-24
按照 Alex 的建议,我设置了 disableAjaxTracking:true,但没有帮助。
这是我的 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>
}
【问题讨论】:
-
我们目前在这里遇到了同样的问题,由于 SignalR 的 ping 生成了 530 万个依赖数据点,因此破坏了免费层。如果我在我的网站上发现了什么,我会及时通知你。
标签: azure-application-insights