问题标签 [azure-application-insights]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
711 浏览

azure - 应用程序洞察——可以在生产中运行吗?

我有一个在 azure 网站上运行的现有 mvc Web 应用程序。

我已经设置了在它运行时运行的应用程序洞察力。

这是推荐的做法吗?这会对我的网站在运行时产生任何影响吗?是否可以让它继续运行,因为它提供了非常有用的数据...

非常感谢

0 投票
2 回答
544 浏览

azure - Monitor WCF service with net.tcp endpoint

We have a WCF service with a net.tcp endpoint and Azure's application insights monitor doesn't seem to work with it. Does it not work with net.tcp endpoints, or is there something we have to do to get it to work?

0 投票
5 回答
32496 浏览

c# - 在 Application Insights 指标中为每个请求添加自定义属性

我想将自定义属性添加到 Application Insights为我的应用程序的每个请求获取的指标中。例如,我想添加用户登录和租户代码,例如我可以在 Azure 门户中对指标进行分段/分组。

相关的文档页面似乎是这个:设置默认属性值

但是这个例子是针对事件(即gameTelemetry.TrackEvent("WinGame");),而不是针对 HTTP 请求:

我的问题:

  1. 请求的相关代码是什么,因为我目前没有特定代码(它似乎由 App Insights SDK 自动管理):是否只是创建一个TelemetryContext足够的?我是否也应该创建一个TelemetryClient,如果是,我应该将它链接到当前请求吗?如何 ?
  2. 我应该把这段代码放在哪里?的Application_BeginRequest方法可以global.asax吗?
0 投票
1 回答
440 浏览

asp.net - 安装 Application Insights 服务器监视器后,站点无法加载 System.IO

我刚刚在测试服务器上安装了 Application Insights Server Monitor,在那里我有一个功能齐全的 .net 4.0 ASP.net 站点。

在网站上启用 AI 后,当我尝试加载它时,出现错误:

当我启用 AI 时,它会将几个 .net dll 复制到站点 /bin/、System.IO.dll 和 System.Threading.Tasks.dll。如果我删除它们,问题就会自行解决,但 AI 不会从该站点接收任何遥测数据。

我需要做什么来解决此问题并启用监控?

0 投票
2 回答
3672 浏览

azure - Application Insights 是否跟踪引荐来源网址?

我想我到处寻找和搜索,但我找不到任何带有推荐人流量数据的图表或报告。我正在使用在预览版 Azure 门户中存储数据的最新版本。在旧的应用程序洞察力(在 VS Online 中)有这些数据。

有谁知道是否可以在新门户中找到它以及在哪里可以找到它?

提前致谢!

0 投票
1 回答
616 浏览

c# - 返回 HttpResponseMessage 并配置 Application Insights 时,WebAPI 响应永远不会完成

我有一个 MVC5/WebAPI2 应用程序,自从我创建 Web 项目以来,它就启用了 Application Insights。

返回对象(例如字符串、模型对象)的 WebApi 方法按预期返回 - 序列化为 JSON 或 XML。

当我创建一个返回 HttpResponseMessage 的操作时,我注意到浏览器中有一个奇怪的行为(用 Chrome 和 IE 测试过)。具体来说,我的内容已返回到浏览器,但“忙碌”指示器从未停止旋转,直到我点击停止按钮或停止 Web 服务器 (Visual Studio 2013)。

我已验证上述方法在没有 Application Insights 的 Web 应用程序中按预期工作。具体来说,一旦数据返回给浏览器,响应就结束了。当使用 Application Insights 将以下方法添加到新创建的应用程序时,会遇到前面描述的行为。

有什么想法吗?

0 投票
2 回答
12452 浏览

azure - VS 2013 中缺少“将 Application Insights 遥测添加到项目”选项

我有一个现有的 Web 项目。我单击了“将 Application Insights Telemetry 添加到项目”,在此过程中的某个时刻,它抛出了一个错误,例如'[...] failed to initialize the powershell host [...]'。然后我根据谷歌搜索尝试了一些东西。项目中没有 ApplicationInsights.config,也没有引用Microsoft.ApplicationInsights.Telemetry.Services

现在在任何地方都找不到“将 Application Insights Telemetry 添加到项目”选项。我什至尝试重新安装 Application Insights 扩展。

我试图通过 git 回滚任何更改,但没有运气。

我的队友都没有在 VS 中看到“将 Application Insights 遥测添加到项目”选项。(我们都在使用 Visual Studio Ultimate 2013 Update 4)

如果我不能让它工作,有没有办法手动设置它?

0 投票
3 回答
10689 浏览

c# - 如何在使用 OWIN 的 WebApi 项目上启用 Application Insights 服务器遥测?

我们在生产中的几个项目中遇到了一堆问题(读取较长的响应时间),并且想看看服务器上到底发生了什么。然后,我按照这篇文章继续将 Application Insights 添加到我们所有的项目中。问题是我们的两个 WebAPI 项目都没有将服务器数据发送到 Azure 门户,而所有其他项目 (MVC 5) 都是。

这是我在 Azure 上访问相应的 Application Insights 刀片时显示的内容:

在此处输入图像描述

我尝试在 Azure VM 的 Application Insights 状态监视器中禁用和重新启用数据收集,在向 API 发出请求时重新启动了几次 IIS,但无济于事。当我在 MVC 项目上启用它时,当我打开站点上的页面时,我几乎可以立即在 Azure 门户上看到数据。

当我看到这些特定项目的数据没有从我们的 Azure 虚拟机发送时,我尝试在我们自己的基础设施中托管的开发环境中设置相同的集合,并且完全相同的情况再次出现,排除了这种可能性这与托管在 Azure VM 中的项目有关。

我不确定是什么阻止了这些项目向 Azure 发送数据,但是通过查看工作项目与非工作项目,我认为这可能与我们的 WebAPI 项目使用新的 OWIN 有某种关系管道,而 MVC 是标准的 MVC 项目。我检查了这两种项目类型的 web.config 文件和 bin 文件夹,它们似乎已被 Insights Monitor 正确修改(我可以看到 bin 文件夹中添加了相同的新 dll 和 web.xml 中添加了相同的 http 模块。配置)。

考虑到这一点,如何使用 Application Insights 为依赖 OWIN/Katana 管道的 WebAPI 项目启用服务器端遥测?在这种情况下,我该怎么做才能找出导致项目不向 Azure 发送数据的确切原因?

0 投票
1 回答
491 浏览

azure - No Application Insights data collected from Sitefinity CMS hosted in Web role

A sitefinity CMS based .net web application is hosted as a web role in azure. The site is working fine as such. Now I've enabled Application Insights in the application but No app insights data is being collected .

This is based on Sitefinity 7.3 version. The app insights assemblies are installed via nuget using "Install-Package Microsoft.ApplicationInsights.Web -Pre" and they were successfully installed. The appropriate modules are added in the web.config and the ApplicationInsights.config file is also added to the solution.

I debugged in emulator and found that the "ApplicationInsightsWebTracking" module is loading fine as well.

As a trial I enabled app insights for a normal asp.net mvc app and found that it is working fine.

any solutions for this would be appreciated.

--edit-- I had added the instrumentation key element with the value from new portal in the applicationInsights.config since nuget install of app insights would not add it automatically.

-- more edit---

1) I have used the correct instrumentation key .

2) while running the app in the local azure emulator in the output window I see this error

A first chance exception of type 'System.IO.FileNotFoundException' occurred in Microsoft.ApplicationInsights.dll WebRequestTrackingModule failed at initialization with exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.Threading.Tasks, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

=== Pre-bind state information === LOG: DisplayName = System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (Fully-specified) LOG: Appbase = file:///D:/src/xyz/Azure/Sitefinity/xyz.Sitefinity/Web/Sitefinity/ LOG: Initial PrivatePath = D:\src\xyz\Azure\Sitefinity\xyz.Property.Sitefinity\Web\Sitefinity\bin Calling assembly : Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. === LOG: This bind starts in default load context. LOG: Using application configuration file: D:\src\xyz\Azure\Sitefinity\xyz.Sitefinity\Web\Sitefinity\web.config LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Redirect found in application configuration file: 1.5.11.0 redirected to 2.6.8.0. LOG: Post-policy reference: System.Threading.Tasks, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a LOG: The same bind was seen before, and was failed with hr = 0x80070002.

at Microsoft.ApplicationInsights.Extensibility.Implementation.TaskTimer.Start(Func1 elapsed) at Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnoisticsEventThrottlingScheduler.InternalCreateAndStartTimer(Int32 intervalInMilliseconds, Action action) at Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnoisticsEventThrottlingScheduler.ScheduleToRunEveryTimeIntervalInMilliseconds(Int32 interval, Action actionToExecute) at Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnoisticsEventThrottlingManager1..ctor(T snapshotContainer, IDiagnoisticsEventThrottlingScheduler scheduler, UInt32 throttlingRecycleIntervalInMinutes) at Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule.Initialize(TelemetryConfiguration configuration) at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.InitializeComponent(Object component, TelemetryConfiguration configuration) at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.InitializeComponents(IEnumerable components, TelemetryConfiguration configuration) at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.InitializeComponents(TelemetryConfiguration configuration) at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.Initialize(TelemetryConfiguration configuration) at Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.get_Active() at Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule..ctor() in f:\Builds\629\AppInsights\DC_Core_release_signed\src\Web\Web\Web.Shared.Net\RequestTracking\WebRequestTrackingModule.cs:line 28

But the application continues to run fine though.

3) In the fiddler I could see a call made to dc.services.visualstudio.com which I believe is for app insights.

4) I have not used perfview tool much. I just ran the command u mentioned in the Menu>Collect>run option of the perfview tool

then I ran the application in visual studio in azure emulator.

once the home page loaded up, I stopped the perfview.( just clicked abort in the menu)

I am not sure if it collected the required data. Only the Eventstats tab had some data. posting it here.

Name Count AverageSize StackCount PerfView/PerfViewLog 33 175 0 Windows Kernel/SysConfig/VolumeMapping 9 40 0 PerfView/ProviderEnableParameters 6 132 0 Microsoft-ApplicationInsights-Extensibility-Web/WebOperationTelemetryInitializerLoaded 6 301 0 KernelTraceControl/MetaData/EventInfo 3 743 0 PerfView/CommandLineParameters 3 1006 0 PerfView/ManifestData 3 16041 0 PerfView/StartAndStopTimes 2 8 0 Microsoft-ApplicationInsights-Extensibility-Web/ManifestData 2 43332 0 Microsoft-ApplicationInsights-Core/ManifestData 2 13128 0 PerfView/SessionParameters 2 82 0 PerfView/WaitForIdle 1 0 0 PerfView/Rundown/Start 1 0 0 KernelTraceControl/WinSat/SystemConfig 1 3136 0 KernelTraceControl/WinSat/WinSPR 1 286 0 KernelTraceControl/WinSat/Metrics 1 1491 0 PerfView/Rundown/Stop 1 0 0 Windows Kernel/SysConfig/BuildInfo 1 140 0 PerfView/Tracing/Start 1 0 0 PerfView/KernelEnableParameters 1 8 0 Windows Kernel/SysConfig/SystemPaths 1 64 0 Windows Kernel/SysConfig/UnknownVolume 1 50 0 Microsoft-ApplicationInsights-Extensibility-Web/WebModuleInitializationExceptionEvent 1 7430 0 PerfView/Tracing/Stop 1 0 0 Windows Kernel/EventTrace 1 324 0 Microsoft-ApplicationInsights-Core/LogError 1 6164 0

0 投票
1 回答
2928 浏览

azure-application-insights - Application Insights 根本没有显示任何数据

我正在试验 Application Insights (v0.14.0) 和我维护的一个 ASP.NET 应用程序,我发现它的数据收集非常不稳定。有一段时间,我只发布了客户端数据(例如浏览器页面加载时间),但没有发布任何服务器指标。根据Application Insights 未在 Azure Preview Portal 中显示数据,我检查了 ApplicationInsights.config 文件是否位于 Web 根文件夹和 bin 文件夹中,并且使用了正确的检测密钥。我们目前没有运行 AI 代理应用程序。

昨晚我们部署了一个新版本的应用程序,没有更改 AI 配置,突然服务器指标开始出现。万岁!不幸的是,45 分钟后,我们为应用程序部署了一个程序集修补程序,在应用程序池被回收后,服务器指标停止了,这一次客户端指标也停止了。

在浏览器中打开 Web 应用程序,我可以看到正在加载的 AI.js 脚本,并查看出站网络调用,我可以看到遥测数据已成功提交给 AI:

有什么想法吗?!