Replies: 1 comment
|
Hi! Thanks for the feedback, glad you were able to enable OTel smoothly :-) The two options that come to mind might not be exactly what you intended, but they are: (1) Move logging over to the Microsoft.Extensions.Logging API, or write a Serilog sink that forwards events to this API, then use the OpenTelemetry SDK to send the results to Seq via OTLP along with traces. In this model, you'd do all of the common enrichment on the OpenTelemetry side. The code churn, or need to write a sink, is probably the weak link, here. There was discussion around a "Logs Bridge API" for .NET so that other logging libraries could forward efficiently to the OpenTelemetry SDK, but I'm not sure where this landed. (2) Use SerilogTracing to capture the traces, and Serilog.Sinks.OpenTelemetry to send logs and traces via OTLP to Seq. In this configuration, Serilog enrichment would be applied to both logs and traces. This one is a lot smoother, and you can continue using System.Diagnostics.Activity instrumentation to capture traces from third-party components. The weak point of this is if you want other OpenTelemetry SDK features that aren't present in SerilogTracing, or if you have another specific need to use the OpenTelemetry SDK. Apart from those, duplicating enrichment across the Serilog and OpenTelemetry SDK configuration is the best I can come up with. HTH! |
Uh oh!
There was an error while loading. Please reload this page.
We are using Serilog and Seq now for a very long time and started recently to add OpenTelemetry tracing to our applications.
Thanks to the good documentation it works like a charm.
Today I realized that our application Signals dont work on the trace entries.
In the end it is quite logical. While Seq offers a unified interface for logging and tracing, they are different Apis in the application. The properties we filter by with the Signals are added to the log entries by enrichers.
Do you have any best practices or planned features to keep these in sync?
The easiest, but not the most elegant solution, I see so far is to "copy" the enrichment in the AddOpenTelemetry call. But it is of course very error prone considering possible future changes.
All reactions