Instrumenting with telemetry
Instrumenting Business Central AL code with telemetry. It covers setting up extension telemetry, emitting custom events to Application Insights or the Event Log, using feature telemetry, and the platform events already logged for extensions. It answers how-to and which-method questions.
- 8Learn pages
- 1subtopics
- 4videos
Path: Development > Programming in the AL language > Instrumenting with telemetry · tier official · system platform · narrative reviewed (checked by Opus)
Overview
Telemetry lets you collect data about usage, errors, performance and lifecycle events from your Business Central application. The pages here cover the full path: the general concepts of adding telemetry signals, the setup needed for extensions, and the AL methods used to emit events.
Start with “Adding Telemetry to Your Business Central Application” for the overall picture, then “Set Up Extension Telemetry in Business Central” to connect an extension to Azure Application Insights through app.json. After that, choose how to log. Feature telemetry (the FeatureTelemetry codeunit) covers usage, errors and uptake. Custom events use Session.LogMessage for Application Insights, or SendTraceTag for the Event Log.
“Data logged to app/extension telemetry” lists the events the platform already emits, such as page interactions, REST API calls, report rendering, error dialogs and resource consumption. Check it before writing custom events. A subtopic holds two reference documentation pages.
Key points
- Extension telemetry is set up by adding the applicationInsightsConnectionString property (or applicationInsightsKey) in app.json; the setup page mentions runtime 7.2.
- Session.LogMessage creates custom telemetry events for Application Insights, with dictionary and dimension overloads, TelemetryScope, DataClassification and CustomDimensions parameters.
- SendTraceTag sends custom trace events to the Business Central Server Event Log, with severity levels, categories and data classification; viewable in Event Viewer.
- Feature telemetry uses the FeatureTelemetry codeunit with LogUsage, LogError and LogUptake to track feature health and adoption.
- Uptake states are Discovered, Set up, Used and Undiscovered; a Telemetry Logger interface and custom dimensions allow filtering and comparing features.
- The platform already logs events for extensions: page interactions, REST API calls, report rendering, error dialogs and resource consumption.
- The Application Insights custom events page references version 29; the Event Log page references 2020 release wave 2.
Subtopics
- Reference documentation (telemetry) (2 pages)
More Learn pages
- Adding Telemetry to Your Business Central Application: Instrument Business Central applications with telemetry to analyze usage, troubleshoot problems, and collect events in Application Insights or Windows logs.
- Creating Custom Telemetry Events for Azure Application Insights: Add custom telemetry events to Business Central extensions with Session.LogMessage, choose their scope, and define dimensions for Application Insights.
- Creating Custom Telemetry Events for the Event Log: Create custom telemetry events with SendTraceTag in Business Central on-premises, view them in Windows event logs, and control logging severity.
- Extension Telemetry Data in Business Central: Learn which Business Central events can reach an extension’s Application Insights resource and how to identify signals that support extension telemetry.
- Feature telemetry: Learn about the telemetry that you can emit from features in Business Central.
- Feature Telemetry module simplifies app health monitoring and tracks feature uptake using three event types: LogUsage for successful feature use, LogError for explicit errors, and LogUptake for…
- Prerequisite: Must implement Telemetry Logger interface in an extension codeunit and register it via OnRegisterTelemetryLogger event subscriber, one per app publisher.
- LogUptake tracks four uptake states: Undiscovered, Discovered (page opens), Set up (user configures), and Used (user attempts feature). Calling with Undiscovered resets uptake state.
- Limit: LogUptake may make database transactions and requires PerformWriteTransactionsInASeparateSession set to true when called from try function.
- Custom dimensions include extension info, user role, environment type, client type, and for errors: stack trace and error text describing the issue.
- If no telemetry logger registered for publisher, server logs event AL0000G7K to environment telemetry indicating app sending data without registered logger.
- In the observatory: Codeunit 8703 “Feature Telemetry”, Codeunit 8708 “Telemetry Loggers”
- Set Up Extension Telemetry in Business Central: Configure a Business Central extension to send telemetry to Azure Application Insights, monitor deployed apps, and add feature or custom telemetry events.
Key facts from Microsoft Learn (CC BY 4.0), in our own words (D106); open the page for the full text.
Videos, posts and code changes
Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.
- #2229 Surface empty BCPT results as a warning instead of silent success (code change): “GetBcptSummaryMD now returns a message that appears in the GitHub step summary”
- #2379 Avoid CI/CD runs for template SHA-only system updates (code change): “Checks if files were actually updated or removed before persisting a new template SHA”
- #2392 AL-Go Telemetry Enhancements: repository fork and hosting information (code change): “AL-Go telemetry now captures whether a repository is a fork and its GitHub hosting type”
- #2395 Prevent workflow telemetry failures from failing the workflow (code change): “WorkflowPostProcess telemetry failures no longer cause the entire workflow to fail”
- #10897 BC IQ - Update data sensitivities for policy history (code change): “Data sensitivities are updated to reflect recent changes to Business Skill”
- #12432 [AB#647643] Retain remote files and safely retire verified local references (code change): “Removes unused deletion telemetry and updates the README configuration guidance”
- Copilot Quota and AI consumption in Business Central. (community post): “telemetry signals 0000LT4 and RT0055 track consumption”
- Handling Business Central Telemetry like a boss: iFacto Telemetry – Pt. 3 (community post): “extends Business Central’s built-in telemetry capabilities by adding custom events”
- Analyzing BC Telemetry with AI with the “BC Telemetry Buddy” (community post): “query Business Central telemetry data through natural conversation using GitHub Copilot”
- What’s New: Telemetry (2023 release wave 2) (video): “AI assisted performance analysis; Key influencers analysis; Top segments analysis”
- What’s Cooking in Business Central: Financial Reporting Enhancements (part 2): Telemetry (video): “telemetry; financial reporting; application insights; row definitions”
- What’s New: Key Updates in our Learning Content (documentation) For Developers (2024 release wave 1) (video): “Telemetry for AL Developers; Security for Developers; Extensibility Overview”
- What’s New: Server and Database - A Faster Runtime (2023 release wave 2) (video): “Exclusive Time Telemetry; Session Creation Performance Improvement”
Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.
What Learn documents here 8 Learn pages
- learnAdding Telemetry to Your Business Central Application2026-11-17
- learnCreating Custom Telemetry Events for Azure Application Insights2026-11-17
- learnCreating Custom Telemetry Events for the Event Log2026-11-17
- learnExtension Telemetry Data in Business Central2026-11-17
- learnFeature telemetry2026-09-22
- learnSession.LogMessage(Text, Text, Verbosity, DataClassification, TelemetryScope, Dictionary of [Text, Text]) Method2026-10-01
- learnSession.LogMessage(Text, Text, Verbosity, DataClassification, TelemetryScope, Text, Text [, Text] [, Text]) Method2026-10-01
- learnSet Up Extension Telemetry in Business Central2026-10-09