topic hubPlatform, DevOps & Performanceofficial - Microsoftreviewed - checked by Opus

Instrumenting with telemetry

Telemetry in AL for Business Central: how to set up Azure Application Insights for an extension, emit custom events with LogMessage, log feature usage, errors and uptake, and what the platform already logs. It answers questions on instrumenting apps and monitoring them in production.

Path: Development > Programming in the AL language > Instrumenting with telemetry · tier official · system platform · narrative reviewed (checked by Opus)

Overview

This section covers how an app or extension publisher gets monitoring data from production. It starts with an introduction to developing telemetry into an application, then setup of the connection to Azure Application Insights, then the ways to emit your own signals. It also covers the obsolete Event Log approach and the telemetry the platform already emits for apps and extensions.

Key points

  • Setting up telemetry in an extension uses applicationInsightsConnectionString or applicationInsightsKey in the app configuration; the page references runtime version 7.2.
  • Custom events for Application Insights are emitted with the LogMessage method, which supports verbosity levels (Critical, Error, Warning, Normal, Verbose), DataClassification and TelemetryScope (extensionpublisher, all).
  • Default dimensions are included in CustomDimensions for custom trace events.
  • Feature telemetry uses the FeatureTelemetry codeunit from the Telemetry AL module: LogUsage, LogError and LogUptake.
  • Uptake states are Discovered, Set up, Used and Undiscovered. The module also offers a Telemetry Logger interface, custom dimensions, and filtering and feature comparison through common telemetry dimensions.
  • The SENDTRACETAG method is obsolete. It writes custom events to the server Event Log, which you can view in Event Viewer. The page references 2020 release wave 2 (v17).
  • The platform already logs telemetry for apps and extensions: page interactions, REST API calls, report rendering, error dialogs and resource consumption.
  • A reference documentation subtopic with 2 pages is also part of this section.

Subtopics

More Learn pages

Videos, posts and code changes

Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 8 Learn pages