Skip to content

Instantly share code, notes, and snippets.

// Error Count grouped by InterfaceId and trace event type (EventName)
traces
| sort by timestamp desc
| where customDimensions.prop__Status == "Failed"
| where customDimensions.EventName != ""
| where tostring(customDimensions.prop__InterfaceId) != ""
| project EventName = tostring(customDimensions.EventName)
, InterfaceId = tostring(customDimensions.prop__InterfaceId)
| summarize Count = count(EventName)
by InterfaceId
// Message Count per EntityType and time bin
traces
| sort by timestamp desc
| where customDimensions.EventName != ""
| where tostring(customDimensions.prop__SpanCheckpointId) contains "PublisherStart"
| project timestamp
, EntityType = tostring(customDimensions.prop__EntityType)
| summarize Count = count(EntityType)
by bin(timestamp, 1h),
EntityType
// Traces with failed status
// Traces can be filtered uncommenting the filters at the bottom and adding the corresponding filter values
traces
| sort by timestamp desc
| where customDimensions.prop__Status == "Failed"
| project
timestamp
, InterfaceId = customDimensions.prop__InterfaceId
, EntityType = customDimensions.prop__EntityType
, EntityId = customDimensions.prop__EntityId
// Correlated traces
// Correlates the Start and Finish checkpoints of both the Publisher and Subscriber spans and returns the relevant key-value pairs
// For those messages that are retried in the Susbcriber span, it shows the values of the last recorded attempt.
// 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 == 'PublisherStart'
| project EntityType = tostring(customDimensions.prop__EntityType)
, PublisherInterfaceId = tostring(customDimensions.prop__InterfaceId)
, EntityId = tostring(customDimensions.prop__EntityId)
// 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
### Variables
@functionHost=https://<function-app-name>.azurewebsites.net
###
POST {{functionHost}}/userupdated
Content-Type: application/json
{
"specversion" : "1.0",
"type" : "user.updated",
using Integration.Observability.Constants;
using Integration.Observability.Extensions;
using Integration.Observability.Helpers;
using Integration.Observability.PubSub.FnApp.Models;
using Microsoft.Azure.ServiceBus;
using Microsoft.Azure.ServiceBus.Core;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using Integration.Observability.Constants;
using Integration.Observability.Extensions;
using Integration.Observability.Helpers;
using Integration.Observability.PubSub.FnApp.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.ServiceBus;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Integration.Observability.Constants;
using Microsoft.Extensions.Logging;
namespace Integration.Observability.Helpers
{
public static class LoggerHelper
{
/// <summary>
/// Calculate LogLevel based on the process status.
/// </summary>
using Integration.Observability.Constants;
using Microsoft.Extensions.Logging;
using System;
namespace Integration.Observability.Extensions
{
/// <summary>
/// ILogger extensions for structured logging using typed signatures.
/// </summary>
public static class LoggerExtensions