Merge branch 'master' of https://github.com/microsoft/BCTech into private/t-vinune/updateAdminCenterAPISamples

This commit is contained in:
t-vinune 2022-02-08 16:41:16 +00:00
Родитель 1377656df1 ae9c2ee7ff
Коммит f091542328
7 изменённых файлов: 318 добавлений и 8 удалений

Просмотреть файл

@ -0,0 +1,41 @@
// KQL samples - Database wait statistics snapshots
// Database wait statistics snapshot taken (raw data)
traces
| where 1==1
and timestamp > ago(60d) // adjust as needed
and customDimensions.eventId == 'RT0025'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, environmentType = customDimensions.environmentType
, environmentName = customDimensions.environmentName
, eventId = customDimensions.eventId
, snapshotId = customDimensions.snapshotId
, message
, customDimensions
// Database wait statistics snapshot entry (raw data)
// Need to join on snapshotId
traces
| where 1==1
and timestamp > ago(60d) // adjust as needed
and customDimensions.eventId == 'RT0026'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, databaseWaitStatisticsCategory = customDimensions.databaseWaitStatisticsCategory
, databaseSignalWaitTimeInMs = customDimensions.databaseSignalWaitTimeInMs
, databaseWaitingTasksCount = customDimensions.databaseWaitingTasksCount
, databaseMaxWaitTimeInMs = customDimensions.databaseMaxWaitTimeInMs
, databaseStartedDuration = customDimensions.databaseStartedDuration
, databaseWaitTimeInMs = customDimensions.databaseWaitTimeInMs
, environmentType = customDimensions.environmentType
, environmentName = customDimensions.environmentName
, eventId = customDimensions.eventId
, snapshotId = customDimensions.snapshotId
, message
, customDimensions

Просмотреть файл

@ -0,0 +1,27 @@
// KQL samples - Errors
// Error dialog shown (raw data)
traces
| where 1==1
and timestamp > ago(60d) // adjust as needed
and customDimensions.eventId == 'RT0030'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, alErrorMessage = customDimensions.alErrorMessage
, alObjectId = customDimensions.alObjectId
, alObjectName = customDimensions.alObjectName
, alObjectType = customDimensions.alObjectType
, alStackTrace = customDimensions.alStackTrace
, clientType = customDimensions.clientType
, companyName = customDimensions.companyName
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, environmentType = customDimensions.environmentType
, environmentName = customDimensions.environmentName
, eventId = customDimensions.eventId
, extensionId = customDimensions.extensionId
, extensionName = customDimensions.extensionName
, extensionVersion = customDimensions.extensionVersion
, failureReason = customDimensions.failureReason
, message
, customDimensions

Просмотреть файл

@ -0,0 +1,44 @@
// KQL samples - SQL Deadlocks
// Not fully tested yet, minor changes might be added before release
// SQL deadlocks (RAW data)
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'RT0028' // starting from version 16.1, the eventId is used to identity signal types
| where customDimensions.alObjectId > 0 // filter out internal server calls
| extend eventId = customDimensions.eventId
, aadTenantId = customDimensions.aadTenantId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, companyName = customDimensions.companyName
, extensionId = customDimensions.extensionId
, extensionPublisher = customDimensions.extensionPublisher
, extensionName = customDimensions.extensionName
, extensionVersion = customDimensions.extensionVersion
, sessionId = customDimensions.sessionId
, alObjectId = customDimensions.alObjectId
, alObjectName = customDimensions.alObjectName
, alObjectType = customDimensions.alObjectType
, alStackTrace = customDimensions.alStackTrace
, clientType = customDimensions.clientType
, sqlStatement = tostring(customDimensions.sqlStatement)
, sqlServerSessionId = customDimensions.sqlServerSessionId
| extend operationType = case(
sqlStatement startswith "UPDATE", "UPDATE"
, sqlStatement startswith "DELETE", "DELETE"
, sqlStatement startswith "BeginTransaction", "BEGIN_TRANS"
, sqlStatement matches regex "INSERT INTO", "INSERT"
, sqlStatement startswith "SELECT", "SELECT"
, sqlStatement matches regex "IF EXISTS \\(SELECT (.*)\\) SELECT", "SELECT'"
, sqlStatement has "SELECT NEXT VALUE FOR", "SELECT_SEQUENCE_VALUE"
, sqlStatement has "SELECT @@SPID", "SELECT_SPID"
, sqlStatement matches regex "(.*)WITH", "SELECT"
, sqlStatement startswith "CREATE TABLE", "CREATE_TABLE"
, sqlStatement startswith "ALTER TABLE", "ALTER_TABLE"
, sqlStatement startswith "exec sp_rename", "RENAME_TABLE"
, sqlStatement matches regex "(.*)DROP TABLE", "DROP_TABLE"
, sqlStatement startswith "SET LOCK_TIMEOUT", "SET_LOCK_TIMEOUT"
, sqlStatement has "sp_getapplock", "GET_APP_LOCK"
, "UNKNOWN"
)

Просмотреть файл

@ -0,0 +1,162 @@
// KQL samples - Task Scheduler events
// Task created (raw data)
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'LC0040'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, codeunitObjectId = customDimensions.codeunitObjectId
, companyName = customDimensions.companyName
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, eventId = customDimensions.eventId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, failureCodeunitObjectId = customDimensions.failureCodeunitObjectId
, formatId = customDimensions.formatId
, isReady = customDimensions.isReady
, languageId = customDimensions.languageId
, notBefore = customDimensions.notBefore
, taskId = customDimensions.taskId
, timeout = customDimensions.timeout
, message
, customDimensions
// Task ready (raw data)
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'LC0041'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, codeunitObjectId = customDimensions.codeunitObjectId
, companyName = customDimensions.companyName
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, eventId = customDimensions.eventId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, failureCodeunitObjectId = customDimensions.failureCodeunitObjectId
, formatId = customDimensions.formatId
, isReady = customDimensions.isReady
, languageId = customDimensions.languageId
, notBefore = customDimensions.notBefore
, taskId = customDimensions.taskId
, timeout = customDimensions.timeout
, message
, customDimensions
// Task removed (raw data)
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'LC0042'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, codeunitObjectId = customDimensions.codeunitObjectId
, companyName = customDimensions.companyName
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, eventId = customDimensions.eventId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, failureCodeunitObjectId = customDimensions.failureCodeunitObjectId
, formatId = customDimensions.formatId
, isReady = customDimensions.isReady
, languageId = customDimensions.languageId
, notBefore = customDimensions.notBefore
, taskId = customDimensions.taskId
, timeout = customDimensions.timeout
, message
, customDimensions
// Task completed (raw data)
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'LC0043'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, attemptNumber = customDimensions.attemptNumber
, codeunitObjectId = customDimensions.codeunitObjectId
, companyName = customDimensions.companyName
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, eventId = customDimensions.eventId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, failureCodeunitObjectId = customDimensions.failureCodeunitObjectId
, formatId = customDimensions.formatId
, isReady = customDimensions.isReady
, languageId = customDimensions.languageId
, notBefore = customDimensions.notBefore
, result = customDimensions.result
, sqlExecutes = customDimensions.sqlExecutes
, sqlRowsRead = customDimensions.sqlRowsRead
, totalTime = customDimensions.totalTime
, taskId = customDimensions.taskId
, timeout = customDimensions.timeout
, message
, customDimensions
// Task cancelled (raw data)
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'LC0044'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, attemptNumber = customDimensions.attemptNumber
, cancelReasonMessage = customDimensions.cancelReasonMessage
, cancelReason = customDimensions.cancelReason
, codeunitObjectId = customDimensions.codeunitObjectId
, companyName = customDimensions.companyName
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, eventId = customDimensions.eventId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, failureCodeunitObjectId = customDimensions.failureCodeunitObjectId
, formatId = customDimensions.formatId
, isReady = customDimensions.isReady
, languageId = customDimensions.languageId
, notBefore = customDimensions.notBefore
, result = customDimensions.result
, sqlExecutes = customDimensions.sqlExecutes
, sqlRowsRead = customDimensions.sqlRowsRead
, totalTime = customDimensions.totalTime
, taskId = customDimensions.taskId
, timeout = customDimensions.timeout
, message
, customDimensions
// Task failed (raw data)
traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'LC0045'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, attemptNumber = customDimensions.attemptNumber
, codeunitObjectId = customDimensions.codeunitObjectId
, companyName = customDimensions.companyName
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, eventId = customDimensions.eventId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, failureCodeunitObjectId = customDimensions.failureCodeunitObjectId
, failureReason = customDimensions.failureReason
, formatId = customDimensions.formatId
, isReady = customDimensions.isReady
, languageId = customDimensions.languageId
, notBefore = customDimensions.notBefore
, result = customDimensions.result
, sqlExecutes = customDimensions.sqlExecutes
, sqlRowsRead = customDimensions.sqlRowsRead
, totalTime = customDimensions.totalTime
, taskId = customDimensions.taskId
, timeout = customDimensions.timeout
, message
, customDimensions

Просмотреть файл

@ -0,0 +1,33 @@
// KQL samples - Verbose Telemetry enabled/disabled
// Verbose Telemetry enabled (raw data)
traces
| where 1==1
and timestamp > ago(60d) // adjust as needed
and customDimensions.eventId == 'RT0023'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, environmentType = customDimensions.environmentType
, environmentName = customDimensions.environmentName
, eventId = customDimensions.eventId
, message
, customDimensions
// Verbose Telemetry disabled (raw data)
traces
| where 1==1
and timestamp > ago(60d) // adjust as needed
and customDimensions.eventId == 'RT0024'
| project timestamp
, aadTenantId = customDimensions.aadTenantId
, component = customDimensions.component
, componentVersion = customDimensions.componentVersion
, environmentType = customDimensions.environmentType
, environmentName = customDimensions.environmentName
, eventId = customDimensions.eventId
, message
, customDimensions

Просмотреть файл

@ -10,8 +10,9 @@ traces // upgrade step started
| where customDimensions.aadTenantId == _aadTenantId
and customDimensions.environmentName == _environmentName
| where customDimensions.alCategory == "ALUpgrade"
| where appInsightsEventId == "AL0000EJ9"
| project alUpgradeTag = tostring(customDimensions.alUpgradeTag)
| where customDimensions.eventId == "AL0000EJ9"
| project timestamp
, alUpgradeTag = tostring(customDimensions.alUpgradeTag)
, companyName = tostring(customDimensions.alCompanyName )
, step_started = timestamp
, session_Id
@ -23,7 +24,7 @@ traces // upgrade step finished successfullay
| where customDimensions.aadTenantId == _aadTenantId
and customDimensions.environmentName == _environmentName
| where customDimensions.alCategory == "ALUpgrade"
| where appInsightsEventId == "AL0000EJA"
| where customDimensions.eventId == "AL0000EJA"
| project alUpgradeTag = tostring(customDimensions.alUpgradeTag)
, customDimensions
, companyName = tostring(customDimensions.alCompanyName)

Просмотреть файл

@ -65,14 +65,16 @@ Signal is added incrementally to Business Central. In this table you can see in
| Appsource validation | 2021 release wave 1 (18.4) | https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-appsource-submission-validation-trace |
| Use of read scale-out in reporting | 2021 release wave 2 (19.1) | https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-reports-trace |
| Feature Telemetry | 2021 release wave 2 (19.1) | (pending docs) |
| Database deadlocks | 2022 release wave 1 (20.0) | (pending link to release note) |
| Database wait statistics | 2022 release wave 1 (20.0) | (pending link to release note) |
| Verbose telemetry enabled | 2022 release wave 1 (20.0) | (pending link to release note) |
| General error dialogs | 2022 release wave 1 (20.0) | (pending link to release note) |
| Task Scheduler Telemetry | 2021 release wave 2 (19.1) | https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-task-scheduler-trace |
| Database deadlocks | 2022 release wave 1 (20.0) | Draft KQL sample ready, https://docs.microsoft.com/en-us/dynamics365-release-plan/2022wave1/smb/dynamics365-business-central/telemetry-when-database-deadlock-occurs-this-logged-telemetry |
| Database wait statistics | 2022 release wave 1 (20.0) | KQL sample ready, https://docs.microsoft.com/en-us/dynamics365-release-plan/2022wave1/smb/dynamics365-business-central/performance-partners-get-database-insights-through-virtual-tables-in-client-pages |
| Verbose telemetry enabled | 2022 release wave 1 (20.0) | KQL sample ready, https://docs.microsoft.com/en-us/dynamics365-release-plan/2022wave1/smb/dynamics365-business-central/telemetry-action-enabling-detailed-telemetry-logged-telemetry |
| General error dialogs | 2022 release wave 1 (20.0) | KQL sample ready, https://docs.microsoft.com/en-us/dynamics365-release-plan/2022wave1/smb/dynamics365-business-central/telemetry-error-dialogs-are-logged-telemetry |
| Permission error dialogs | 2022 release wave 1 (20.0) | (pending link to release note) |
| Use of read scale-out in web service calls | 2022 release wave 1 (20.0) | (pending link to release note) |
| Report action and document type in reporting | 2022 release wave 1 (20.0) | https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-reports-trace |
| Report action and document type in reporting | 2022 release wave 1 (20.0) | KQL sample ready, https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/telemetry-reports-trace |
| Environment lifecycle and configuration changes| 2022 release wave 1 (20.0) | (pending link to release note) |
| Session stops | 2022 release wave 1 (20.0) | (pending link to release note) |
# Disclaimer
Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual, royalty-free right to use and modify the software code provided by us for the purposes of illustration ("Sample Code") and to reproduce and distribute the object code form of the Sample Code, provided that you agree: (i) to not use our name, logo, or trademarks to market your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend us and our suppliers from and against any claims or lawsuits, whether in an action of contract, tort or otherwise, including attorneys fees, that arise or result from the use or distribution of the Sample Code or the use or other dealings in the Sample Code. Unless applicable law gives you more rights, Microsoft reserves all other rights not expressly granted herein, whether by implication, estoppel or otherwise.