Analyzing Job Queue Lifecycle Trace Telemetry

APPLIES TO: Business Central 2020 release wave 2, version 17.2, and later

Job queue lifecycle telemetry gathers data about the following operations:

  • A job queue entry was enqueued.
  • A job queue entry was started.
  • A job queue entry finished. Provides information as to whether it was successful or failed.

For information about creating and managing job queue entries, see Use Job Queues to Schedule Tasks in the Business Central application help.

Job queue entry enqueued

Occurs when a job queue entry is sent to the job queue to eventually be run. A job queue entry is sent to the queue when its status is changed from On Hold to Ready or if it's a recurring job queue entry. Recurring job queue entries are automatically enqueued after each run.

General dimensions

Dimension Description or value
message Job queue entry enqueued: {alJobQueueId}
severityLevel 1

Custom dimensions

The following table explains custom dimensions that are specific to this trace.

Dimension Description or value
eventId AL0000E24
alJobQueueId Specifies the ID of the job queue entry.
alJobQueueIsRecurring Specifies whether the job queue is recurring. Yes indicates it's recurring. No indicates it's not recurring.
alJobQueueObjectId Specifies the ID of the object that the job queue entry runs.
alJobQueueObjectType Specifies the type of the object that the job queue entry runs, for example Report or Codeunit.
alJobQueueStatus Ready indicates it's a non-recurring job queue entry or the first run of a recurring job queue entry that's ready to run. On Hold with Inactivity Timeout indicates it's a recurring job query entry that's ready to run.

Error

Information if the job queue entry fails to be sent to the queue.

General dimensions

Dimension Description or value
message Job queue entry not enqueued: {alJobQueueId}
severityLevel 2

Custom dimensions

The following table explains custom dimensions that are specific to this trace.

Dimension Description or value
eventId AL0000FNY
See common custom dimensions

Success

Information if the job queue entry was successfully sent to the queue.

General dimensions

Dimension Description or value
message Job queue entry enqueued: {alJobQueueId}
severityLevel 1

Custom dimensions

The following table explains custom dimensions that are specific to this trace.

Dimension Description or value
eventId AL0000E24
See common custom dimensions

Job queue entry started

Occurs when a job queue entry starts to run.

General dimensions

Dimension Description or value
message Job queue entry started: {alJobQueueId}
severityLevel 1

Custom dimensions

The following table explains custom dimensions that are specific to this trace.

Dimension Description or value
eventId AL0000E25
See common custom dimensions

Job queue entry finished (request)

Occurs when a request for a job queue entry finishes running.

General dimensions

Dimension Description or value
message Job queue entry finished: {alJobQueueId}
severityLevel 1

Custom dimensions

Dimension Description or value
eventId AL0000E26
alJobQueueExecutionTimeInMs Specifies how many milliseconds it took to run the job queue entry.
See common custom dimensions

Job queue entry finished (run)

Occurs when a job queue entry finishes running.

General dimensions

Dimension Description or value
message JobID = {alJobQueueId}, ObjectType = {alJobQueueObjectType}, ObjectID = {alJobQueueObjectId}, Status = Finished, Result = Success, Company = {alJobQueueCompanyName}, Scheduled Task Id = {alJobQueueScheduledTaskId}
severityLevel 1

Custom dimensions

Dimension Description or value
eventId AL0000E26
See common custom dimensions

Job queue entry failed with error

Occurs when a job queue entry fails to run.

General dimensions

Dimension Description or value
message Job queue entry errored: {alJobQueueId}
severityLevel 2

Custom dimensions

Dimension Description or value
eventId AL0000HE7
See common custom dimensions

Common custom dimensions

The following table explains custom dimensions that are common to all job queue entry traces.

Dimension Description or value
alCategory AL JobQueueEntries
alJobQueueCompanyName Specifies the current company.
alJobQueueScheduledTaskId Specifies the ID of the scheduled task.
alJobQueueEarliestStartDateTime Specifies the earliest start date/time for the job queue entry.
alJobQueueId Specifies the ID of the job queue entry.
alJobQueueIsRecurring Specifies if the job queue is recurring. True indicates it's recurring. False indicates it's not recurring.
alJobQueueObjectId Specifies the ID of the object that the job queue entry runs.
alJobQueueObjectType Specifies the type of the object that the job queue entry runs, for example Report or Codeunit.
alJobQueueStackTrace Specifies the AL stack trace of the job queue entry. This dimension was introduced in version 20.5.
alJobQueueStatus Ready indicates it's a non-recurring job queue entry or the first run of a recurring job queue entry that's ready to run. In Process indicates it's being run. Error indicates it encountered an error while running. On Hold indicates it's being queued. Finished indicates it's finished without error. On Hold with Inactivity Timeout indicates it's a recurring job query entry that's ready to run.
alObjectId 1351, which is the ID of the system application codeunit that subscribes to the telemetry events.
alObjectName Telemetry Subscribers, which is the name of the system application codeunit that subscribes to the telemetry events.
alObjectType CodeUnit
component Dynamics 365 Business Central Server.
componentVersion Specifies the version number of the component that emits telemetry (see the component dimension.)
deprecatedKeys A comma-separated list of all the keys that have been deprecated. The keys in this list are still supported but will eventually be removed in the next major release. We recommend that update any queries that use these keys to use the new key name.
environmentName Specifies the name of the tenant environment. See Managing Environments.
environmentType Specifies the environment type for the tenant, such as Production, Sandbox, Trial. See Environment Types
extensionName Specifies the name of the extension that contains the object run by the job queue entry.
extensionId Specifies the ID of the extension that contains the object run by the job queue entry.
extensionVersion Specifies the version of the extension that contains the object run by the job queue entry.
telemetrySchemaVersion Specifies the version of the Business Central telemetry schema.

Event IDs

The following table describes the event IDs that are currently emitted.

Job queue status Event ID Description
Enqueued AL0000FNY Occurs when a job queue entry fails to enqueue and this happens if no task scheduler is created behind it.
Enqueued AL0000E24 Occurs when a job queue entry successfully enqueues and will after the specified alJobQueueEarliestStartDateTime.
Started AL0000E25 Occurs right before the Job Queue Start codeunit is triggered and that codeunit will run the specified Object ID to run.
Finished successfully AL0000E26 Occurs at the very end of the job queue run.
Error AL0000HE7 Occurs when a job queue errors, and this is the first thing that is triggered before the updating of records.

See also

Monitoring and Analyzing Telemetry
Enable Sending Telemetry to Application Insights
Use Job Queues to Schedule Tasks