I'm trying to disable codeless monitoring for an Azure api app we have deployed. We want to track all request manually using the trackNodeHttpRequest method because the app insight transaction log is filled with requests ever 30 seconds from the app gateway health checks.
When I set setAutoCollectRequests(false) it doesn't seem to stop the auto monitoring / codeless sdk. What am I missing here?
const appInsights = require("applicationinsights");
appInsights.setup()
.setAutoCollectRequests(false)
.setAutoCollectConsole(true, true)
.start();
app.use((req, res, next) => {
if (!req.url.toLowerCase().startsWith('/swagger')) {
appInsights.defaultClient.trackNodeHttpRequest({request:req, response:res});
}
next();
});
Resolved the issue by disabling the app insights configuration in the api app settings. This is where the documentation is a little confusing https://learn.microsoft.com/en-us/azure/azure-monitor/app/azure-web-apps-nodejs?tabs=windows
If both auto-instrumentation monitoring and manual SDK-based
instrumentation are detected, only the manual instrumentation settings
will be honored. This is to prevent duplicate data from being sent. To
learn more about this, check out the troubleshooting section below.
I did not find this the case with app insights turned on and setAutoCollectRequests(false) in my code it was ignoring my manual tracking code above. Disabling the setting still allows me to see my manual tracking in the app insights.
Related
How do I enable and view SqlClient traces on Azure?
I have a web app hosted on Azure and it uses SqlClient.
I know that we can use XPerf/PerfView to collect and view traces. But I am not sure how to use it when the web app is hosted on Azure app service.
If it is a web app you could use Application Insights to track calls made using SqlClient. These calls are autocollected as described here. Do mind that, in order for full sql query tracking, you will need to opt-in for this feature as described here:
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { module. EnableSqlCommandTextInstrumentation = true; });
As a bonus you get detailed insights regarding your apps workings, performance and failures.
I have a Node.js functions app running in azure and it is processing thousands of requests every minute, I would like to enable Application Insights using the Azure Portal in order to diagnose an issue but I fear this may interrupt the function while it configures itself.
Is this a valid concern?
All the documentation I have found regarding Application Insights does not mention the impact on any running applications.
Adding AI integration is only a matter of adding a key to app settings, but any edits to app settings require a function app to restart, so yes it will affect your function.
I did some tests, and I made a request to it after enabling Application Insights. It will indeed be affected for a few seconds because it will change the app settings and then restart the Azure function.
I am able to configure app insight directly from app insight tab, by either creating new one or selecting the existing one. In this case, it is updating APPINSIGHTS_INSTRUMENTATIONKEY and APPINSIGHTS_CONNECTION_STRING in app settings.
But, when I tried to configure app insights through app setting directly, its not working. I have configured APPINSIGHTS_INSTRUMENTATIONKEY and APPINSIGHTS_CONNECTION_STRING in app settings of a azure function app to directly. But, the related app insight is not integrated with function app.
Can anyone suggest, why it is not working.?
Looking at the release notes for SDK Version 2.0.12998:
App Insights configuration will use the APPLICATIONINSIGHTS_CONNECTION_STRING app setting if it is set (APPINSIGHTS_INSTRUMENTATIONKEY is the fallback and continues to work as-is).
Furthermore, if you read the documentation for App Insights Connection String, you will notice that when you use connection string, you can specify custom endpoints. This is not possible if you just specify the instrumentation key. In that case, SDK will connect to default endpoints.
Having difficulty getting diagnostic details out of my logic app. I have enabled the diagnostics, bit the event hub and log analytics for work flow runtime. But at this time I'm not seeing anything coming out. I have also checked the diagnostic logs table and nothing. this is a very basic POC logic app.
Do I need to do anything else.
You can set up the log analytics(OMS) workspace in azure and link it with the logic app. For the existing logic apps, we can add this via diagnostics settings under monitoring.
I have a asp.net web api application deployed as an azure web app. One of the endpoints occasionally throws an exception. Normally this isn't an issue for us. We have an ExceptionLogger attached to the api services. This has been in place for sometime and normally works fine.
Currently we see that a 500 response comes back from the server, but nothing is logged. I have tried setting GlobalConfiguration.Configuration.IncludeErrorDetailPolicy to IncludeErrorDetailPolicy.Always, but the response always comes back with no body content.
What else can I do to track the source of the problem?
If you have a consistent repro, then you can use remote debugging to attach to your web app and debug it (https://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-troubleshoot-visual-studio/).
Failing that, you can enable better diagnostic logs using the web app settings. Information on how to do so is here:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/ under the section "Enabling diagnostic logs".
In your case you should have application logging enabled, and perhaps failed request tracing would be useful (FREB).
For even more tools you can use the Support Site Extension (http://azure.microsoft.com/blog/2014/12/01/new-updates-to-support-site-extension-for-azure-websites/) which would allow you to look at live event logs and HTTP traffic. For a deeper dive into debugging in Azure App Service see: https://channel9.msdn.com/Events/Ignite/2015/BRK4704.