ApplicationInsights-dotnet | ApplicationInsights-dotnet | Monitoring library
kandi X-RAY | ApplicationInsights-dotnet Summary
kandi X-RAY | ApplicationInsights-dotnet Summary
ApplicationInsights-dotnet
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ApplicationInsights-dotnet
ApplicationInsights-dotnet Key Features
ApplicationInsights-dotnet Examples and Code Snippets
Community Discussions
Trending Discussions on ApplicationInsights-dotnet
QUESTION
I'm trying to enhance RequestTelemetry in AppInsights from HttpTrigger Azure Function v3.
Function is initialized with DI and Startup class.
...ANSWER
Answered 2021-Mar-22 at 06:25Update:
Added Op's solution: by using request.HttpContext?.Features.Get()
, it worked fine.
Please uninstall the 2 Application Insights packages
: Microsoft.ApplicationInsights
and Microsoft.ApplicationInsights.AspNetCore
.
By default, Application Insights packages do not collect activity tags. So this should be the reason.
I tested your azure function without installing the above 2 Application Insights packages
, it works well. Here is the screenshot of the test result:
Adding my local.settings.json here for your reference, the code is the same as yours:
QUESTION
Problem: Application insights by default does not track SQL parameters in dependencies telemetry. I want to either enable parameter tracking or manually add parameters.
Little background: I had .Net Core 2 app with application insights. I was reading request body and saving it as custom property with TelemetryInitializer
. I migrated to .Net Core 3 where I was not able to use TelemetryInitializer
anymore as .Net Core 3 disabled synchronous IO. Similar issue described here. So I have implemented application insights middleware as per this example. I am using EF Core
for all my database access.
Question: I found this issue which says that it is possible to "access SqlCommand operation detail in TelemetryInitializer". But how can I achieve this using application insights middleware?
...ANSWER
Answered 2020-Oct-08 at 15:30You do not have to write asp.net core middleware for this. Instead you should be using a TelemetryInitializer. Given an intializer like this:
QUESTION
We're using the Application Insights SDK (v2.14) in our .NET Framework 4.7.2 application and have been able to track SQL dependencies (albeit without query text) successfully.
We're now migrating to the Microsoft.Data.SqlClient package from System.Data.SqlClient so we can also do Advanced SQL tracking to see the full query text in our telemetry. We've updated the ApplicationInsights.config file to set EnableSqlCommandTextInstrumentation to true.
However, after installing the latest Microsoft.Data.SqlClient package (2.01 at the time of writing) we're no longer getting ANY SQL dependencies being tracked for code using the client.
What's the issue?
...ANSWER
Answered 2020-Oct-08 at 08:01The issue is the combination of versions of the Application Insights SDK and Microsoft.Data.SqlClient.
Version 2.0 of Microsoft.Data.SqlClient changed the naming for EventSource tracing and in doing so effectively broke the support for SQL dependency tracking in the AI SDK for versions up to 2.15 (at the time of writing).
The workaround is to downgrade Microsoft.Data.SqlClient to version 1.1.3 which has the old EventSource naming. This will restore SQL dependency tracking (and show SQL Query text if you add the EnableSqlCommandTextInstrumentation flag).
There is are issues reported against the AI SDK to fix this (2032 in particular) that will hopefully mean this gets fixed in the future.
I hope this helps anyone who is pulling their hair out as much as I did :)
QUESTION
Currently I am using a .NET Core Web Application built using Service Stack. Logging is currently provided by using NLog, with Azure Application Insights as a target.
Currently when I log messages and exceptions, I am coming across some weird behaviours:
...ANSWER
Answered 2020-Mar-13 at 22:57NOTE ServiceStack 5.8 has been released that fixes the issue.
Have looked at Service Stack ver. 5.7 Logger Interface. And this will not work:
QUESTION
I'm using Application Insights for Console App (.NET Core 2.1).
I need to gather more information about dependencies(requests/responses) than ApplicationInsights.DependencyCollector
does.
So I've tried the approach described in this blog. And it works for requests.
But it does not work for responses. Because in the code above Activity.Current
is null
:
ANSWER
Answered 2018-Nov-07 at 10:28This comment really helped.
The most complicated scenario is when you want to access response and enrich telemetry based on it. you can still use diagnostic source Stop event, however, this becomes hacky because AppInsights listens to the same even and your listener needs to receive the Stop event before AppInsights.
So I just initialized my 'enrichment' observer class before the telemetry client. And Activity.Current
is no longer null
in OnHttpRequestOutStop
.
QUESTION
Running AI 2.4, using the AppInsights Monitor app, on Windows Server 2012 R2, monitoring a public-facing (publishing) SharePoint site.
Every so often, w3wp crashes (throws up a "do you want to debug this?" dialog), and the following is recorded in the event log:
...ANSWER
Answered 2018-Jun-29 at 16:33System.Diagnostics.DiagnosticsSource 4.5.0 (the one with the fix) has Assembly version 4.0.3.0.
And from your exception, it seems you are still using
System.Diagnostics.Activity,System.Diagnostics.DiagnosticSource, Version=4.0.2.0
Please check your bindings redirect and check if you still reference 4.4.0 somehow. You can also enable fuslog to see a detailed binding error info.
QUESTION
Goal: Forward log entries from NLog to Azure Application Insights. Starting from: https://github.com/Microsoft/ApplicationInsights-dotnet-logging
I created a very basic console application:
...ANSWER
Answered 2018-Apr-16 at 11:11Telemetry items are buffered (for 30 seconds by default, see the source code) before the client send the data to the portal. So you have to keep the console open for at least that amount of time or call Flush()
manually or set the developer mode to true:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ApplicationInsights-dotnet
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page