This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Integration.Observability.Constants | |
{ | |
/// <summary> | |
/// Constants used for Logging and Tracing | |
/// </summary> | |
public class LoggingConstants | |
{ | |
/// <summary> | |
/// To identify the tracing span checkpoints (e.g. start or finish of each span) | |
/// Enum values follow the structure spanId + checkPoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Extensions.Options; | |
using Newtonsoft.Json; | |
using ServerlessRequestBin.DurableFunctions.Models; | |
namespace ServerlessRequestBin.DurableFunctions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
traces | |
| sort by timestamp desc | |
| where customDimensions.EventId > 1 | |
| where customDimensions.LogLevel == 'Error' | |
| project EventId = tostring(customDimensions.EventId) | |
| summarize Count = count(EventId) by EventId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Properties used with Azure Functions structure logging are logged as customDimensions.prop__{name} | |
//To filter events created by our custom structured logging, get only those traces where EventId > 1 | |
traces | |
| sort by timestamp desc | |
| where customDimensions.EventId > 1 | |
| project Level = customDimensions.LogLevel | |
, EventId = customDimensions.EventId | |
, CheckPoint = customDimensions.prop__CheckPoint | |
, CorrelationId = customDimensions.prop__CorrelationId | |
, Description = customDimensions.prop__Description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0", | |
"logging": { | |
"logLevel": { | |
"default": "Information" | |
}, | |
"aggregator": { | |
"batchSize": 100, | |
"flushTimeout": "00:00:10" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Azure.WebJobs; | |
using Microsoft.Extensions.Logging; | |
using Newtonsoft.Json; | |
using System; | |
using System.IO; | |
namespace PacodelaCruz.AzureFunctions.Logging | |
{ | |
public static class ProcessOrder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Newtonsoft.Json; | |
using System; | |
using System.IO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace PacodelaCruz.AzureFunctions.Logging | |
{ | |
/// <summary> | |
/// Contains constants and enums for consistent structured logging | |
/// </summary> | |
internal static class LoggingConstants | |
{ | |
// Template for consisted structured logging accross multiple functions, each field is described below: | |
// EventDescription is a short description of the Event being logged. | |
// EntityType: Business Entity Type being processed: e.g. Order, Shipment, etc. |