azure-application-insights

Application Insights tracking only failed ASP.NET MVC Web API requests

一笑奈何 提交于 2019-12-01 09:08:40
I have a ASP.NET Web API controller that provides a saveAndNew operation. This class is derived from System.Web.Http.ApiController as expected. Application Insights is correctly configured using version 2.1.0 of the SDK and the default settings in ApplicationInsights.config. If a request to the mentioned operation fails - for example with status code 400 - the request is recorded correctly in App Insights. The problem is that if the operation SUCCEEDS (status code 200) nothing is recorded in Application Insights . I've used Fiddler to see if the request is made to the App Insights track

HttpContext and TelemetryInitializer

倖福魔咒の 提交于 2019-12-01 06:38:25
I want to attach the user's "client_id" claim as a property to every request sent to Application Insights. From what I've read, I should be implementing ITelemetryInitializer but I need the HttpContext for the request in order to retrieve "client_id". See my initialiser: public class ClaimTelemetryInitializer : ITelemetryInitializer { public HttpContext HttpContext { get; set; } public void Initialize(ITelemetry telemetry) { this.AddTelemetryContextPropertFromClaims(telemetry, "client_id"); } private void AddTelemetryContextPropertFromClaims(ITelemetry telemetry, string claimName) { if

Completely Remove ApplicationInsights from Visual Studio 2015

∥☆過路亽.° 提交于 2019-12-01 06:32:24
I've looked around, and haven't been able to find a good answer, so I'm posting this question in the hopes that it can be a sort of "go to" for others hoping to entirely remove Application Insights. The first, and move obvious thing I tried was uninstalling the Tool from the Tools and Extensions, but unfortunately this made things worse! Now I'm not able to create MVC projects at all, due to missing DLLs. I tried searching for templates that might include AI as well, but couldn't find any, so I'm stuck wondering where else it is buried that it can cause these sorts of issues. Has anyone out

HttpContext and TelemetryInitializer

社会主义新天地 提交于 2019-12-01 05:22:36
问题 I want to attach the user's "client_id" claim as a property to every request sent to Application Insights. From what I've read, I should be implementing ITelemetryInitializer but I need the HttpContext for the request in order to retrieve "client_id". See my initialiser: public class ClaimTelemetryInitializer : ITelemetryInitializer { public HttpContext HttpContext { get; set; } public void Initialize(ITelemetry telemetry) { this.AddTelemetryContextPropertFromClaims(telemetry, "client_id"); }

Completely Remove ApplicationInsights from Visual Studio 2015

允我心安 提交于 2019-12-01 05:17:01
问题 I've looked around, and haven't been able to find a good answer, so I'm posting this question in the hopes that it can be a sort of "go to" for others hoping to entirely remove Application Insights. The first, and move obvious thing I tried was uninstalling the Tool from the Tools and Extensions, but unfortunately this made things worse! Now I'm not able to create MVC projects at all, due to missing DLLs. I tried searching for templates that might include AI as well, but couldn't find any, so

Azure Resource Template Dependencies / Application Insights

Deadly 提交于 2019-12-01 04:00:59
I have a chicken and egg problem deploying Application Insights with my web application to Azure. In the ARM template, the Application Insights module is dependent upon the web site for the application id (see dependencies in the ARM templates below). On the other hand, in order to fully instrument the web application, I need the instrumentation key from the Application Insights Module. How does one get around this? Application Insights View From the Portal ARM Template for Web App ARM Template for Application Insights Brett The solution is to have the connection strings and app settings

Flush() in Azure App Insights

≡放荡痞女 提交于 2019-12-01 00:14:33
For Flush() method in Azure App Insights, I was wondering if it impacts the performance of the project? I tried to remove Flush() and all the custom data are still sent to App Insights.So my question should be why do we need the Flush() ? Can we remove it? Flush() on TelemetryClient pushes all the data it currently has in a buffer to the App Insights service. You can see its source code here: https://github.com/Microsoft/ApplicationInsights-dotnet/blob/3115fe1cc866a15d09e9b5f1f7f596385406433d/src/Microsoft.ApplicationInsights/TelemetryClient.cs#L593 . Normally, Application Insights will send

Flush() in Azure App Insights

假装没事ソ 提交于 2019-11-30 18:11:28
问题 For Flush() method in Azure App Insights, I was wondering if it impacts the performance of the project? I tried to remove Flush() and all the custom data are still sent to App Insights.So my question should be why do we need the Flush() ? Can we remove it? 回答1: Flush() on TelemetryClient pushes all the data it currently has in a buffer to the App Insights service. You can see its source code here: https://github.com/Microsoft/ApplicationInsights-dotnet/blob

Use Azure Application Insights with Azure WebJob

大城市里の小女人 提交于 2019-11-30 08:01:11
The Azure documentation covers many examples of integrating Azure Application Insights into different applications types, such as ASP.NET, Java, etc. However, the documentation doesn't show any examples of integrating Application Insights into a Azure WebJob. Does anyone have link to an example or article that covers how to integrate Azure Application Insights into an Azure WebJob that's built as a Console App? I have written a console application that tracks events and metrics via Application Insights, and I figure a WebJob won't be all that different, by adding the following NuGet packages:

Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation

六月ゝ 毕业季﹏ 提交于 2019-11-30 07:54:53
问题 I am getting this error whenever I try and run a webjob project with application insight and entity framework. System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)' I have installed the following nuget packages Microsoft