{"title":"Analyze agent lifecycle telemetry","url":"https://jonas-paprotka.de/docs/dev-itpro/administration/telemetry-agent-lifecycle-trace/","by":"JOP-AL","license":"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-agent-lifecycle-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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-agent-lifecycle-trace","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn how to analyze Business Central agent lifecycle telemetry for agent creation, configuration changes, state changes, and task activity.","date":"2026-09-22","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Analyze agent lifecycle telemetry","slug":"analyze-agent-lifecycle-telemetry","at":0,"chars":10996},{"level":2,"title":"Agent created","slug":"agent-created","at":353,"chars":2375},{"level":3,"title":"General dimensions","slug":"general-dimensions","at":426,"chars":343},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions","at":769,"chars":1319},{"level":3,"title":"Sample KQL code","slug":"sample-kql-code","at":2088,"chars":640},{"level":2,"title":"Agent configuration changed","slug":"agent-configuration-changed","at":2728,"chars":4430},{"level":3,"title":"General dimensions","slug":"general-dimensions-1","at":3044,"chars":475},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-1","at":3519,"chars":2244},{"level":3,"title":"Sample KQL code","slug":"sample-kql-code-1","at":5763,"chars":718},{"level":3,"title":"Sample KQL code for tracking state changes","slug":"sample-kql-code-for-tracking-state-changes","at":6481,"chars":677},{"level":2,"title":"Agent task created","slug":"agent-task-created","at":7158,"chars":3657},{"level":3,"title":"General dimensions","slug":"general-dimensions-2","at":7305,"chars":454},{"level":3,"title":"Custom dimensions","slug":"custom-dimensions-2","at":7759,"chars":1319},{"level":3,"title":"Sample KQL code","slug":"sample-kql-code-2","at":9078,"chars":643},{"level":3,"title":"Sample KQL code for task creation by agent","slug":"sample-kql-code-for-task-creation-by-agent","at":9721,"chars":500},{"level":3,"title":"Sample KQL code for model usage in tasks","slug":"sample-kql-code-for-model-usage-in-tasks","at":10221,"chars":594},{"level":2,"title":"Related information","slug":"related-information","at":10815,"chars":181}],"text":"# Analyze agent lifecycle telemetry\nAPPLIES TO: Business Central 2026 release wave 1, version 28.0, and later\nAgent lifecycle telemetry gathers data about the creation and configuration of AI agents in Business Central. This telemetry helps you track agent setup, monitor configuration changes, and understand how agents and their tasks are being used.\n## Agent created\nOccurs when a new agent is created in Business Central.\n### General dimensions\nDimension|Description or value\nmessage|Agent created: {agentDisplayName}\nseverityLevel|1 (Informational)\nuser_Id|The user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. See telemetry-enable-application-insights#assign-a-telemetry-id-to-users.\n### Custom dimensions\nDimension|Description or value\naadTenantId|Specifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.\nenvironmentName|Specifies the name of the tenant environment. See Managing Environments<tenant-admin-center-environments>.\nenvironmentType|Specifies the environment type for the tenant, such as Production or Sandbox. See tenant-admin-center-environments#types-of-environments.\neventId|LC0067\nagentUserId|Specifies the security ID (GUID) of the agent user.\nagentUserName|Specifies the unique user name identifier for the agent.\nagentDisplayName|Specifies the human-readable display name of the agent.\nstate|Specifies the agent's state. Values are Enabled or Disabled.\ninstructionsHash|Specifies the SHA-256 hash of the agent's instructions. Empty if no instructions are set.\nmodelId|Specifies the ID of the AI model configured for the agent.\nmodelName|Specifies the display name of the AI model.\nmodelAvailability|Specifies the availability status of the model. Values are Preview, Available, Obsolete, or Retired.\nmodelIsDefault|Specifies whether this is the platform default model. Values are true or false.\nmodelRetirementDate|Specifies the retirement date for the model, if set.\n### Sample KQL code\nThis KQL code can help you get started analyzing agent creation:\n```kql\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'LC0067'\n| project timestamp\n, aadTenantId = customDimensions.aadTenantId\n, environmentName = customDimensions.environmentName\n, environmentType = customDimensions.environmentType\n, agentDisplayName = customDimensions.agentDisplayName\n, agentUserName = customDimensions.agentUserName\n, state = customDimensions.state\n, modelId = customDimensions.modelId\n, modelName = customDimensions.modelName\n, modelAvailability = customDimensions.modelAvailability\n```\n## Agent configuration changed\nOccurs when an agent's configuration is modified in Business Central. This event includes information about which fields changed and their previous values.\nThe substatePreviousValue dimension has the following availability:\n> APPLIES TO: Business Central 2026 release wave 2 and later\n### General dimensions\nDimension|Description or value\nmessage|Agent configuration changed: {agentDisplayName}\nseverityLevel|1 (Informational) when the configured model is available or in preview. The value is 2 (Warning) when the model is obsolete or retired.\nuser_Id|The user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. See telemetry-enable-application-insights#assign-a-telemetry-id-to-users.\n### Custom dimensions\nDimension|Description or value\naadTenantId|Specifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.\nenvironmentName|Specifies the name of the tenant environment. See Managing Environments<tenant-admin-center-environments>.\nenvironmentType|Specifies the environment type for the tenant, such as Production or Sandbox. See tenant-admin-center-environments#types-of-environments.\neventId|LC0066\nagentUserId|Specifies the security ID (GUID) of the agent user.\nagentUserName|Specifies the unique user name identifier for the agent.\nagentDisplayName|Specifies the human-readable display name of the agent.\nstate|Specifies the agent's current state after the change. Values are Enabled or Disabled.\ninstructionsHash|Specifies the SHA-256 hash of the agent's current instructions.\nmodelId|Specifies the ID of the AI model currently configured for the agent.\nmodelName|Specifies the display name of the AI model.\nmodelAvailability|Specifies the availability status of the model. Values are Preview, Available, Obsolete, or Retired.\nmodelIsDefault|Specifies whether this is the platform default model. Values are true or false.\nmodelRetirementDate|Specifies the retirement date for the model, if set.\nchangedFields|Specifies a comma-separated list of fields that changed (for example, \"state,modelId\"). Empty when no specific fields were flagged.\nagentUserNamePreviousValue|Specifies the agent's user name before the change. Empty when the user name did not change.\nagentDisplayNamePreviousValue|Specifies the agent's display name before the change. Empty when the display name did not change.\nstatePreviousValue|Specifies the agent's state before the change. Empty when the state did not change.\nsubstatePreviousValue|Specifies the agent's substate before the change, such as the state before the agent was archived. Empty when the substate did not change.\nmodelIdPreviousValue|Specifies the configured model ID before the change. Empty when the model did not change.\ninstructionsHashPreviousValue|Specifies the SHA-256 hash of the agent's instructions before the change. Empty when the instructions did not change.\n### Sample KQL code\nThis KQL code can help you get started analyzing agent configuration changes:\n```kql\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'LC0066'\n| project timestamp\n, aadTenantId = customDimensions.aadTenantId\n, environmentName = customDimensions.environmentName\n, environmentType = customDimensions.environmentType\n, agentDisplayName = customDimensions.agentDisplayName\n, changedFields = customDimensions.changedFields\n, oldState = customDimensions.statePreviousValue\n, newState = customDimensions.state\n, oldSubstate = customDimensions.substatePreviousValue\n, oldModelId = customDimensions.modelIdPreviousValue\n, newModelId = customDimensions.modelId\n```\n### Sample KQL code for tracking state changes\nThis KQL code can help you track when agents are enabled or disabled:\n```kql\ntraces\n| where timestamp > ago(30d) // adjust as needed\n| where customDimensions.eventId == 'LC0066'\n| where customDimensions.changedFields contains 'state'\n| project timestamp\n, aadTenantId = customDimensions.aadTenantId\n, environmentName = customDimensions.environmentName\n, agentDisplayName = customDimensions.agentDisplayName\n, oldState = customDimensions.statePreviousValue\n, newState = customDimensions.state\n| summarize StateChanges = count() by tostring(agentDisplayName), tostring(oldState), tostring(newState)\n| order by StateChanges desc\n```\n## Agent task created\nOccurs when a new agent task is created in Business Central. Agent tasks represent individual work items assigned to agents.\n### General dimensions\nDimension|Description or value\nmessage|Agent task created: {taskId}\nseverityLevel|1 (Informational) when the selected model is available or in preview. The value is 2 (Warning) when the model is obsolete or retired.\nuser_Id|The user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. See telemetry-enable-application-insights#assign-a-telemetry-id-to-users.\n### Custom dimensions\nDimension|Description or value\naadTenantId|Specifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.\nenvironmentName|Specifies the name of the tenant environment. See Managing Environments<tenant-admin-center-environments>.\nenvironmentType|Specifies the environment type for the tenant, such as Production or Sandbox. See tenant-admin-center-environments#types-of-environments.\neventId|LC0068\ntaskId|Specifies the unique identifier for the agent task.\nagentUserId|Specifies the security ID (GUID) of the agent user that owns the task.\nagentDisplayName|Specifies the human-readable display name of the agent that owns the task.\nmodelSource|Specifies where the model configuration came from. Values are Task, Agent, or Default. This indicates the level at which the model was defined.\nmodelId|Specifies the ID of the AI model used by the task.\nmodelName|Specifies the display name of the AI model.\nmodelAvailability|Specifies the availability status of the model. Values are Preview, Available, Obsolete, or Retired.\nmodelIsDefault|Specifies whether this is the platform default model. Values are true or false.\nmodelRetirementDate|Specifies the retirement date for the model, if set.\n### Sample KQL code\nThis KQL code can help you get started analyzing agent task creation:\n```kql\ntraces\n| where timestamp > ago(60d) // adjust as needed\n| where customDimensions.eventId == 'LC0068'\n| project timestamp\n, aadTenantId = customDimensions.aadTenantId\n, environmentName = customDimensions.environmentName\n, environmentType = customDimensions.environmentType\n, taskId = customDimensions.taskId\n, agentDisplayName = customDimensions.agentDisplayName\n, modelSource = customDimensions.modelSource\n, modelId = customDimensions.modelId\n, modelName = customDimensions.modelName\n, modelAvailability = customDimensions.modelAvailability\n```\n### Sample KQL code for task creation by agent\nThis KQL code can help you understand which agents are creating the most tasks:\n```kql\ntraces\n| where timestamp > ago(30d) // adjust as needed\n| where customDimensions.eventId == 'LC0068'\n| summarize\n    TaskCount = count()\n  , UniqueModels = dcount(tostring(customDimensions.modelId))\n  by\n    AgentDisplayName = tostring(customDimensions.agentDisplayName)\n  , EnvironmentName = tostring(customDimensions.environmentName)\n| order by TaskCount desc\n```\n### Sample KQL code for model usage in tasks\nThis KQL code can help you understand which models are being used and how they were configured:\n```kql\ntraces\n| where timestamp > ago(30d) // adjust as needed\n| where customDimensions.eventId == 'LC0068'\n| summarize\n    TaskCount = count()\n  by\n    ModelName = tostring(customDimensions.modelName)\n  , ModelSource = tostring(customDimensions.modelSource)\n  , ModelAvailability = tostring(customDimensions.modelAvailability)\n| order by TaskCount desc\n```\nTo learn more about how to set up alerting on Business Central telemetry, see telemetry-alert.\n## Related information\nMonitoring and Analyzing Telemetry<telemetry-overview>\nEnable Sending Telemetry to Application Insights<telemetry-enable-application-insights>\ntelemetry-alert"}