Instrumenting an application for telemetry

This article describes how you can implement custom telemetry signals in your application for emitting telemetry data. This data can then be collected and visualized for analyzing the application against the desired business goals, troubleshooting, and more.

Telemetry overview

One aspect of event logging is the data collection about the working and deployment infrastructure of an application to diagnose conditions and troubleshoot problems that affect its operation and performance. For example, this type of event logging includes Business Central Server events and trace events like SQL and AL method (function) traces.

Another aspect of logging is telemetry, which is the collection of data about how your application works in production. Telemetry can tell you about specific activities that users perform within the application in the production environment. Telemetry also helps troubleshooting in those instances where you aren't able to reproduce the conditions experienced by the user or have no access to the user's environment. Telemetry can be divided into different categories, like: telemetry for engineering, telemetry about the business, telemetry for customers.

Creating custom telemetry signal

There are two different resources where telemetry trace signals can be sent for monitoring and analyzing: Event Log and Microsoft Azure Application Insights. By default, the Business Central application is instrumented to emit several system telemetry trace signals to these destinations. Custom telemetry trace signals enable you to send telemetry data from anywhere in the application code to either of these destinations.

The procedure for creating custom telemetry signals is different for each resource. Your choice might also depend on whether you're developing for Business Central online or on-premises.

Resource Description Online On-premises More information
Application Insights Create custom telemetry signals that are sent to an Application Insights resource in Azure. Application Insights is a service hosted within Azure that gathers telemetry data for analysis and presentation.

Extension developers can specify whether the signal is only sent to the extension publisher or also to the VAR partner telemetry resource.

You create these custom trace signals by using the LOGMESSAGE method in the code.
check mark for feature. check mark for feature See...
Event Log Create custom telemetry trace signals that are sent to the Event Log of the Business Central Server machine. You create these custom trace signals by using the SENDTRACETAG method in the code. check mark for feature. See...


Using Application Insights is recommended.

See Also

Monitoring and Analyzing Telemetry
Monitoring Business Central Server Events