You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Application Insight's operation id is pushed out if you set `operationId` LogEvent property. If it's present, AI's
337
-
operation id will be overridden by the value from this property.
348
+
Application Insight's operation id is set from the following sources in order of precedence:
349
+
350
+
1.`operationId` LogEvent property
351
+
2.`TraceId` LogEvent property
352
+
3.`Activity.TraceId` (captured at log time)
338
353
339
354
This can be set like so:
340
355
@@ -357,6 +372,23 @@ public class OperationIdEnricher : ILogEventEnricher
357
372
Application Insight supports component version and is pushed out if you set `version` log event property. If it's
358
373
present, AI's operation version will include the value from this property.
359
374
375
+
## Using with SerilogTracing
376
+
377
+
[SerilogTracing](https://github.com/serilog-tracing/serilog-tracing) provides tracing primitives that integrate with Serilog's structured logging. When used with this sink, tracing context is automatically included in Application Insights telemetry.
378
+
379
+
The following LogEvent properties are mapped to Application Insights telemetry:
Precedence for `Context.Operation.Id`: `operationId` property > `TraceId` property > `Activity.TraceId` (when both `operationId` and `TraceId` properties are absent).
391
+
360
392
## Using with Azure Functions
361
393
362
394
Azure functions has out of the box integration with Application Insights, which automatically logs functions execution
Copy file name to clipboardExpand all lines: src/Serilog.Sinks.ApplicationInsights/Sinks/ApplicationInsights/TelemetryConverters/TelemetryConverterBase.cs
+52-10Lines changed: 52 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,26 @@ public abstract class TelemetryConverterBase : ITelemetryConverter
0 commit comments