# Analyzing stopped session telemetry
In Business Central, a background session is a session without a UI that runs a specified codeunit. Background sessions are started and stopped by calling the ../developer/methods-auto/session/session-startsession-integer-integer-string-table-method and ../developer/methods-auto/session/session-stopsession-method methods from AL. With Business Central online, sessions can be stopped by using the admin center, which indirectly calls the StopSession method. See Managing Sessions<tenant-admin-center-manage-sessions>.
With Application Insights, you can record attempts to stop sessions, either by direct calls to the StopSession method or from the admin center.
## The StopSession method was invoked on session
A call to the StopSession method was made from AL or from the admin center. The event is also emitted when the call doesn't stop a session. Check the result dimension to determine the outcome.
### General dimensions
This table explains the columns included in the trace emitted when a session stop is attempted.
Dimension|Description or value
message|The StopSession method was invoked on session {stoppingSessionID}
operation_Name|StopSessionOperation
severityLevel|1
### Custom dimensions
The following table describes the most relevant custom dimensions of the trace.
|Column|Description or value|
|eventId|RT0029|
|alObjectId*<#1>|The ID of the object that called the StopSession method to cancel the session|
|alObjectName*<#1>|The name of the object that called the StopSession method to cancel the session|
|alObjectType*<#1>|The type of the object, like codeunit or page, that called the StopSession method to cancel the session|
|alStackTrace*<#1>|The stack trace for the session stop in AL.|
|cancellationComment|The comment defined in the StopSession method call. Stopped by management PowerShell cmdlet indicates a management request, such as a request from the Business Central admin center or a management PowerShell cmdlet.|
|clientType|The type of client that called the StopSession method, such as Background, WebClient, or ManagementClient. ManagementClient indicates a management request, not exclusively a request from the Business Central admin center. See ClientType option type<../developer/methods-auto/clienttype/clienttype-option>.|
|companyName*<#1>|The name of the company that was open during the session|
|currentSessionID|The ID of the session that called the StopSession method to stop the session identified by stoppingSessionID.|
|extensionName|The name of the extension that included the code that called the StopSession method.|
|result|The Boolean outcome recorded for the stop request. A value of True indicates that the stop request was accepted.|
|stoppingSessionID|The ID of the session that the StopSession method attempted to stop.|
|stoppingSessionIsAdmin|Indicates whether the target session was running as an administrator.|
|See common custom dimensions<#other>||
* Not shown for sessions canceled from the admin center.
Other custom dimensions
The following table explains other custom dimensions of the trace.
Dimension|Description or value
aadTenantId|The Microsoft Entra tenant ID that's used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.
component|Dynamics 365 Business Central Server
componentVersion|The version number of the component that emits telemetry (see the component dimension)
environmentName|The name of the tenant environment. This dimension isn't included for Business Central on-premises environments. See Managing environments<tenant-admin-center-environments>.
environmentType|The environment type for the tenant, such as Production, Sandbox, Trial. See tenant-admin-center-environments#types-of-environments.
telemetrySchemaVersion|The version of the Business Central telemetry schema
## Related information
Monitoring and Analyzing Telemetry<telemetry-overview>
Enable Sending Telemetry to Application Insights<telemetry-enable-application-insights>
Monitoring and Analyzing Long Running SQL Queries On-Premises<monitor-long-running-sql-queries-event-log>
The Business Central Administration Center<tenant-admin-center>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-stop-session-trace, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/administration/telemetry-stop-session-trace/
