serilog-sinks-opentelemetry icon indicating copy to clipboard operation
serilog-sinks-opentelemetry copied to clipboard

Option to send spans to the logs endpoint

Open srogovtsev opened this issue 6 months ago • 3 comments

https://github.com/serilog/serilog-sinks-opentelemetry/blob/2c9ebbc9e12e5fd6ec4c47294deffb7d1bb8146f/src/Serilog.Sinks.OpenTelemetry/Sinks/OpenTelemetry/OpenTelemetrySink.cs#L50-L71

If I understand the code correctly, if LogEvent is recognized as a span (i.e. it has SpanStartTimestamp property and some other things), it won't end up in logging even if tracing is not enabled - i.e., basically, lost.

I find this somewhat unexpected (but maybe I'm just reading it wrong), and I'd probably prefer this to be a configurable choice between

  • "send to traces if trace endpoint present, otherwise logs" (default)
  • "send to traces only, lost if not configured"
  • "always send to traces and logs" (useful when logging and tracing endpoint are not well coordinated)

srogovtsev avatar Aug 20 '24 17:08 srogovtsev