title | description | author | ms.topic | ms.search.keywords | ms.date | ms.reviewer | ms.author | ms.custom |
---|---|---|---|---|---|---|---|---|
Analyze email trace telemetry |
Learn about the email telemetry in Business Central |
kennienp |
conceptual |
administration, tenant, admin, environment, sandbox, telemetry |
01/02/2024 |
jswymer |
kepontop |
bap-template |
APPLIES TO: [!INCLUDEprod_short] 2020 release wave 2, update 17.2, and later
Email telemetry gathers data about the following operations:
- An email was sent successfully
- An attempt to send an email failed
From [!INCLUDEprod_short] 2023 release wave 1, update 23.2, and later, the following operations are also emitted to telemetry:
- Authentication to an SMTP server succeded/failed
- Connection to an SMTP server succeded/failed
Before you can collect this data, you'll have to set up email. For more information, see Set Up Email in the [!INCLUDEprod_short] application help.
Tip
You can also view failed emails in the Email Outbox page in the [!INCLUDEprod_short] client.
Occurs when an email was successfully sent from the client.
Dimension | Description or value |
---|---|
message | Email sent successfully |
user_Id | [!INCLUDEuser_Id] |
Dimension | Description or value |
---|---|
aadTenantId | [!INCLUDEaadTenantId] |
clientType | [!INCLUDEclientType] |
companyName | [!INCLUDEcompanyName] |
environmentName | [!INCLUDEenvironmentName] |
environmentType | [!INCLUDEenvironmentType] |
alConnector | Specifies the email-provider connector used to send the email. Possible values include:
|
alEmailMessageID | Specifies the GUID assigned to email, like C7A56676-9F3F-4044-90F0-D7F3196AC366. |
alObjectId | 8888, which is the ID of the system application codeunit that sends emails. |
alObjectName | Email Dispatcher, which is the name of the system application codeunit that sends the emails. |
alObjectType | CodeUnit |
eventId | AL0000CTV |
Occurs when an email failed to be sent from the client.
Dimension | Description or value |
---|---|
message | Failed to send email. |
user_Id | [!INCLUDEuser_Id] |
Dimension | Description or value |
---|---|
aadTenantId | [!INCLUDEaadTenantId] |
clientType | [!INCLUDEclientType] |
companyName | [!INCLUDEcompanyName] |
environmentName | [!INCLUDEenvironmentName] |
environmentType | [!INCLUDEenvironmentType] |
alConnector | Specifies the email-provider connector used to send the email. Possible values include:
|
alEmailMessageID | Specifies the GUID assigned to email, like C7A56676-9F3F-4044-90F0-D7F3196AC366. |
alErrorCallStack | Specifies the AL callstack when the error occurred. This dimension was added in version 19.0. |
alErrorText | Specifies the AL error message. This dimension was added in version 19.0. |
alObjectId | 8888, which is the ID of the system application codeunit that sends emails. |
alObjectName | Email Dispatcher, which is the name of the system application codeunit that sends the emails. |
alObjectType | CodeUnit |
eventId | AL0000CTP |
Occurs when the SMTP module is authenticating to an SMTP server.
Dimension | Description or value |
---|---|
message | Authenticated to SMTP server |
user_Id | [!INCLUDEuser_Id] |
Dimension | Description or value |
---|---|
aadTenantId | [!INCLUDEaadTenantId] |
clientType | [!INCLUDEclientType] |
companyName | [!INCLUDEcompanyName] |
environmentName | [!INCLUDEenvironmentName] |
environmentType | [!INCLUDEenvironmentType] |
eventId | AL0000GKK |
alAuthenticated | Specifies whether authentication succeeded. Possible values are Yes or No. |
This KQL code can help you get started analyzing SMTP authentication failures:
// Authenticated to SMTP server
// Introduced in version 22.3
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'AL0000GKK'
| where customDimensions.alAuthenticated == 'No'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, companyName = customDimensions.companyName
, clientType = customDimensions.clientType
[!INCLUDEtelemetry_alert_learn_more]
Occurs when the SMTP module is connecting to an SMTP server.
Dimension | Description or value |
---|---|
message | Connected to SMTP server |
user_Id | [!INCLUDEuser_Id] |
Dimension | Description or value |
---|---|
aadTenantId | [!INCLUDEaadTenantId] |
clientType | [!INCLUDEclientType] |
companyName | [!INCLUDEcompanyName] |
environmentName | [!INCLUDEenvironmentName] |
environmentType | [!INCLUDEenvironmentType] |
eventId | AL0000GKJ |
alConnected | Specifies whether connection succeeded. Possible values are Yes or No. |
This KQL code can help you get started analyzing SMTP connection failures:
// Connected to SMTP server
// Introduced in version 22.3
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'AL0000GKJ'
| where customDimensions.alConnected == 'No'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, companyName = customDimensions.companyName
, clientType = customDimensions.clientType
[!INCLUDEtelemetry_alert_learn_more]
Occurs when the SMTP module is sending an email.
Dimension | Description or value |
---|---|
message | Email sent |
user_Id | [!INCLUDEuser_Id] |
Dimension | Description or value |
---|---|
aadTenantId | [!INCLUDEaadTenantId] |
clientType | [!INCLUDEclientType] |
companyName | [!INCLUDEcompanyName] |
environmentName | [!INCLUDEenvironmentName] |
environmentType | [!INCLUDEenvironmentType] |
eventId | AL0000GKL |
alSent | Specifies whether sending the email succeeded. Possible values are Yes or No. |
This KQL code can help you get started analyzing failures in sending emails:
// Connected to SMTP server
// Introduced in version 22.3
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'AL0000GKL'
| where customDimensions.alSent == 'No'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, companyName = customDimensions.companyName
, clientType = customDimensions.clientType
[!INCLUDEtelemetry_alert_learn_more]
Use this KQL code if you want to set up alerts on SMTP failures, either failures authenticating/connecting to SMTP servers or failures on sending emails.
traces
| where timestamp > ago(1d) // adjust as needed
| where customDimensions.eventId == 'AL0000CTP'
or (customDimensions.eventId == 'AL0000GKK' and customDimensions.alAuthenticated == 'No')
or (customDimensions.eventId == 'AL0000GKJ' and customDimensions.alConnected == 'No')
or (customDimensions.eventId == 'AL0000GKL' and customDimensions.alSent == 'No')
| extend EventId = customDimensions.eventId
| summarize count() by
aadTenantId = tostring( customDimensions.aadTenantId )
, environmentName = tostring( customDimensions.environmentName )
, environmentType = tostring( customDimensions.environmentType )
, companyName = tostring( customDimensions.companyName )
, clientType = tostring( customDimensions.clientType )
, ErrorType = case (
EventId == 'AL0000CTP', 'Other'
, EventId == 'AL0000GKK', 'SMTP authentication'
, EventId == 'AL0000GKJ', 'SMTP connection'
, EventId == 'AL0000GKL', 'SMTP email'
, 'Unknown'
)
[!INCLUDEtelemetry_alert_learn_more]
Monitoring and Analyzing Telemetry
Enable Sending Telemetry to Application Insights
Alert on Telemetry