Developers can emit telemetry to Application Insights from AL code

Enabled for Public preview General availability
Admins, makers, or analysts, automatically This feature is released. Oct 1, 2020 This feature is released. Oct 1, 2020

Business value

App developers can now instrument their code both for their own use and to make it possible for reselling partners to troubleshoot potential issues.

Feature details

In this wave, we add a new function, Session.LogMessage, that has the following signature:

Session.LogMessage(
      EventID : String
    , Message: String
    , DataClassification: DataClassification
    , Scope: ExtensionPublisher|All
    , Verbosity: Verbosity 
    , Dimensions: Dictionary of [String, String]
)

If the Verbosity level is set to Normal and DataClassification is set to SystemMetadata, then the platform will emit telemetry. The value of the Scope parameter determines where telemetry will be sent. If set to ExtensionPublisher, telemetry is only sent to the Application Insights account specified in the app.json file. If set to All, telemetry is also sent to the Application Insights account specified in the Business Central administration center.

See also

Creating Custom Telemetry Traces for Application Insights Monitoring (docs)