Configure Application Insights post deployment
Microsoft charges for Application Insights based on the amount of data that Application Insights collects. Depending on the topology and SKU size, Sitecore deploys environments with either a Basic or an Enterprise pricing plan.
To avoid unexpected bills and limit costs, Microsoft sets a configurable daily cap on the amount of data collected. If you reach that cap, the Application Insights service stops saving the telemetry data and Microsoft sends a warning email message so that you can extend it if necessary.
Sitecore deployments that use either the Sitecore Azure toolkit or Azure Marketplace, including Managed Cloud and self-managed Azure customers, are set up with an Application Insights standard daily cap of 100GB per day. This is by default. Sitecore is configured by default to gather telemetry information, which it submits to Application Insights. The combination of these configurations means that, depending on use, the standard deployment can potentially reach the daily cap. Therefore, to lower costs, you can reduce the amount of data that Sitecore is logging or, to ensure Sitecore continues logging data, increase the daily cap.
Reducing the Sitecore telemetry logging
You can use the Microsoft App Service Editor ®, (formerly Visual Studio Online (Monaco)), to reduce the amount that Sitecore logs for Application Insights on a counter-by-counter basis.
The Sitecore custom performance counters are disabled by default and are not recorded in Application Insights.
To enable custom performance counters so they synchronize with Application Insights every 5 minutes:
-
Go to the App Service Editor, WWWROOT, and open the
Web.configSet
file. -
Set
"storeSitecoreCountersInApplicationInsights:define"
where the value =True
To use the Microsoft App Service to reduce or configure the performance counters being logged:
-
Log in to the Azure portal with an account that has access to the subscription that hosts the app services where your Sitecore solution is deployed.
-
In Microsoft Azure, All resources, Resources groups, click the relevant resource group to open the App Service for your Content Management role.
-
In the App Service menu, Development Tools, click App Service Editor.
-
In the App Service Editor, navigate to WWWROOT\App_Config\Sitecore\Azure. Open the
Sitecore.Cloud.ApplicationInsights.config
file and scroll to thecounterLoader
section. -
Edit the file and remove any
<add category=”…
entries for the performance counters that you no longer want to record in Application Insights. Alternatively, you can reduce the telemetry to the lowest possible throughput by removing all<add category=”…
entries. -
Repeat steps 1 to 5 for the Content Delivery, Processing, and Reporting App Services roles.
Increasing the daily cap
To modify the Application Insights Daily Cap:
-
Log in to the Azure portal with an account that has access to the subscription that hosts the app services where your Sitecore solution is deployed.
-
In Microsoft Azure, All resources, click the relevant resource group to open the Application Insights resource.
-
In the Application Insights menu, under Configure, Usage and estimated costs, click Daily cap.
-
In the Daily volume cap dialog box, adjust the properties to match the Application Insights data volume requirements for your Sitecore Installation.
-
Click OK, to apply the changes and close the form.
NoteThe daily cap is set for the entire Application Insights service, regardless of the number of exporting nodes. The maximum daily limit that you can set is 1,000GB.
To capture more errors in your data samples, go to the Data sampling drop down list and select All data (100%).
Using activity logs
An activity log describes what happens to resources in your subscription when someone is working with the Azure Platform. This. includes: who was working with the platform, what activities occurred, and when. You can also see the status of operations applied to services.
There are many different categories of activity logs:
-
Administrative - Contains a record of all create, update, delete, and action operations performed through Resource Manager. The Administrative category also includes any changes to role-based access control in a subscription.
-
Service Health - Contains a record of any service health incidents that occurred in Azure.
-
Alert - Contains a record of every time an Azure alert is activated. For example, if the %CPU time of a resource ran over 80%. You can create your own alert rules then receive notifications if they are activated.
-
Autoscale - Contains the record of any events related to the operation of the autoscale engine. This is based on any autoscale settings you defined in your subscription.
-
Recommendation - This category contains recommendation events from Azure Advisor.
-
Security - Contains a record of any alerts generated by the Azure Security Center.
-
Policy and Resource Health – These are reserved categories and currently do not contain any records.
Similar to Application Insights, the data stored in Activity Logs is only kept for 90 days. If you want to access it for longer than 90 days, you can archive the Azure Activity Log.