Skip to content

Instantly share code, notes, and snippets.

@pacodelacruz
Last active February 11, 2021 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pacodelacruz/8fdc65a6aefe37b50ca2fd2c5bd2bc62 to your computer and use it in GitHub Desktop.
Save pacodelacruz/8fdc65a6aefe37b50ca2fd2c5bd2bc62 to your computer and use it in GitHub Desktop.
// All trace events related to the 'BatchPublisher' span
// Correlates the Start and Finish checkpoints and returns the relevant key-value pairs
// Traces can be filtered uncommenting the filters at the bottom and adding the corresponding filter values
traces
| sort by timestamp desc
| where customDimensions.prop__SpanCheckpointId == 'BatchPublisherStart'
| project BatchPublisherStart = timestamp
, BatchPublisherStartLevel = customDimensions.LogLevel
, InterfaceId = customDimensions.prop__InterfaceId
, EntityType = customDimensions.prop__EntityType
, BatchId = tostring(customDimensions.prop__BatchId)
, BatchPublisherStartStatus = customDimensions.prop__Status
| join kind = leftouter (
traces
| where customDimensions.prop__SpanCheckpointId == 'BatchPublisherFinish'
| project BatchPublisherFinish = timestamp
, BatchPublisherBatchId = tostring(customDimensions.prop__BatchId)
, BatchPublisherFinishLevel = customDimensions.LogLevel
, EntityId = customDimensions.prop__EntityId
, BatchPublisherFinishStatus = customDimensions.prop__Status
, RecordCount = customDimensions.prop__RecordCount
) on $left.BatchId == $right.BatchPublisherBatchId
| sort by BatchPublisherStart desc
| project
BatchPublisherStart
, InterfaceId
, EntityType
, BatchId
, EntityId
, RecordCount
, BatchPublisherStartStatus
, BatchPublisherFinishStatus
// Optional filters, uncomment if/when required
//| where InterfaceId contains "" // Filters based on the InterfaceId
//| where EntityType == "" // Filters based on the EntityType
//| where EntityId == "" // Filters based on the EntityId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment