Skip to content

Option to send spans to the logs endpoint #154

Open
@srogovtsev

Description

@srogovtsev

public void Emit(LogEvent logEvent)
{
bool? isSpan = null;
if (_logsSink != null)
{
isSpan = IsSpan(logEvent);
if (!isSpan.Value)
{
_logsSink.Emit(logEvent);
return;
}
}
if (_tracesSink != null)
{
isSpan ??= IsSpan(logEvent);
if (isSpan.Value)
{
_tracesSink.Emit(logEvent);
}
}
}

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions