Episerver Customer-Centric DXP uses Microsoft's Application Insights with ready-to-use tools to manage application performance and monitor web apps.
Application Insights lets you troubleshoot exceptions that happen in the web apps and performance issues. See Creating an Episerver cloud account to request access to Application Insights for your environment. To learn more about how to use this tool, see Microsoft's documentation section, which includes links to free online video tutorials.
Application Insights is configured automatically for all sites in the DXP, but depending on the site architecture, some further configuration might be needed to fully use its features.
Application Insight API key
Customers and partners can request an Application Insights API key for envionments from email@example.com.
- The API Key has list and read-only permissions.
- You get only one key per requested environment; that is, if you request keys for Integration, Preproduction, and Production environments, you will get three keys.
- If you need a new key, the previous key is overwritten.
For information about read API access key, see Using the API.
Runtime and buildtime instrumentation
By default, sites in DXP use Runtime instrumentation, which does not require any changes in the web application, but does not store log messages from the Episerver platform in Application Insights; you can find the logs in the DXP Management Portal.
To use all the Application Insights features, you should use both runtime and buildtime instrumentation. The buildtime instrumentation is enabled when installing Application Insights SDK. This consists of two NuGet packages:
- Microsoft.ApplicationInsights.Web to collect telemetry.
- Microsoft.ApplicationInsights.TraceListener to get the logs (see also Custom logging below).
See Instrument web apps at runtime with Application Insights Codeless Attach (Microsoft documentation) for details about the difference between runtime and buildtime instrumentation.
Single Page Application configuration
Set up usage tracking parameters to ensure that the website traffic volume monitoring is correct. For websites using the Single Page Application (SPA) concept, you need to specifically configure the page view tracking, because pages on these websites will not reload during usage. See Consumption metrics how to configure page view tracking for SPAs.
To direct Episerver logs to Application Insights as traces for you to explore and search, configure diagnostics tracing with System.Diagnostics.Trace.
Install the NuGet package Microsoft.ApplicationInsights.TraceListener, which modifies your web.config to add trace listeners. When installed, a configuration entry similar to the following code is added to web.config.
<system.diagnostics> <trace autoflush="true" indentsize="0"> <listeners> <add name="myAppInsightsListener" type="Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener, Microsoft.ApplicationInsights.TraceListener" /> </listeners> </trace> </system.diagnostics>
See Application Insights logging adapters and Explore .NET/.NET Core and Python trace logs in Application Insights (Microsoft Documentation) for information and examples.
Note: After you have installed the Microsoft.ApplicationInsights.TraceListener package, you also need to install Microsoft.ApplicationInsights.Web package, to collect site telemetry.
When configured, your logs are merged with the other telemetry coming from your application, so that you can identify the traces associated with servicing each user request, and correlate them with other events and exception reports.
If you already have your own Application Insights settings via ApplicationInsights.config file when you deploy your site to DXP, the Applications Insights resource provisioned by DXP overwrites your Instrumentation Key, which means that any custom logs or telemetry information that you are adding is saved to an Application Insights resource provisioned by DXP.
Last updated: Apr 02, 2020