MS Azure Application Insights¶
Azure Application Insights is a monitoring and diagnostics service provided by Microsoft Azure that allows you to collect and analyze telemetry data. In Virto Commerce, it collects metrics, application telemetry data, and application trace logging data within the Application Insights module.
Virto Commerce Application Insights module¶
Application Insights was integrated to the VC platform till the release of 3.314.0 version, where it was replaced with Serilog library.
You can still use MS Azure Application Insights by installing it separately as a module:
- Without extra settings.
- Setting the required configurations if you prefer a customized version.
Install Application Insights module
Configuring Application Insights module¶
Add and customize the Application Insight section in the appsettings.json
file.
Node | Default or sample value | Description |
---|---|---|
SamplingOptions.Processor |
Adaptive Fixed |
Lets you choose between two sampling methods:
|
IncludedTypes |
Dependency Event Exception PageView Request Trace |
A semi-colon delimited list of types to be sampled. The specified types will be sampled. All telemetry of other types will always be transmitted. All types are included by default. |
ExcludedTypes |
Dependency Event Exception PageView Request Trace |
A semi-colon delimited list of types not to be sampled. All telemetry of the specified types is transmitted. The types that aren't specified will be sampled. Empty by default. |
EnableSqlCommandTextInstrumentation |
true false |
For SQL calls, the name of the server and database is always collected and stored as the name of the collected Dependency Telemetry. Another field, called data, can contain the full SQL query text. To opt in to SQL Text collection, set this setting to true . |
IgnoreSqlTelemetryOptions |
Controls the Application Insights telemetry processor that excludes SQL queries related to dependencies. Any SQL command name or statement that contains a string from the QueryIgnoreSubstrings options will be ignored. |
Example¶
To configure 'ApplicationInsights':
-
Use current active telemetry configuration which is already initialized in most application types like ASP.NET Core:
-
Configure Platform AP telemetry behavior inside the
VirtoCommerce:ApplicationInsights
section:{ "VirtoCommerce": { "ApplicationInsights": { "SamplingOptions": { "Processor": "Adaptive", "Adaptive": { "MaxTelemetryItemsPerSecond": "5", "InitialSamplingPercentage": "100", "MinSamplingPercentage": "0.1", "MaxSamplingPercentage": "100", "EvaluationInterval": "00:00:15", "SamplingPercentageDecreaseTimeout": "00:02:00", "SamplingPercentageIncreaseTimeout": "00:15:00", "MovingAverageRatio": "0.25" }, "Fixed": { "SamplingPercentage": 90 }, "IncludedTypes": "Dependency;Event;Exception;PageView;Request;Trace", "ExcludedTypes": "" }, "EnableSqlCommandTextInstrumentation": true, "IgnoreSqlTelemetryOptions": { "QueryIgnoreSubstrings": [ "[HangFire].", "sp_getapplock", "sp_releaseapplock" ] } } } }