Skip to content

Equivalent of "logLevel" for spans #3205

@svrnm

Description

@svrnm

What are you trying to achieve?

Note: Maybe this has been discussed before and I didn't find the conclusion/reason behind it, so please point me to it if so.

A very common property of logs is the level (info, warn, debug, error, ...). This level is useful for plenty of applications, so I was wondering if a similar equivalent would be valuable for spans:

  • A super detailed trace could hold "debug" spans that can be dropped if not needed and kept in the circumstances they are valuable (a related discussion to this happened in the #otel-php-auto-instr slack channel a while back for a very verbose instrumentation. Quoting @pdelewski: "[...] his verbosity is unexpected from application developer point of view, but might be useful from framework development side"
  • Sampling decisions might already take the Status of a span into account, this might be even more helpful (keep 100% of error level, 50% of warning level, 20% of info level, 0% of debug level, etc.)

What did you expect to see?

By either updating the Span Status to allow more attributes or by attributing an additional attribute or a semantic convention, this could be addressed. Based on the fact that the tracing API is stable, I assume mapping this with a semantic convention would be best.

Additional Context

There might be alternative approaches to this, like setting a priority or importance on a span. I just wanted to get some feedback if this might be a valuable addition to spans&traces.

Updated 2024/01/26

Based on the discussions a key point of this issue is the need for being able to drop a partial span tree, e.g.

Span 1 (important) -> Span 2 (not important) -> Span 3 (not important) -> Span 4 (important)

would become

Span 1 -> Span 4.

As stated throughout the discussions this is not a trivial thing to do, but my hope was that there are potential ways to accomplish the same and that this issue could provide a place to discuss

Metadata

Metadata

Assignees

No one assigned

    Labels

    spec:traceRelated to the specification/trace directorytriage:deciding:community-feedbackOpen to community discussion. If the community can provide sufficient reasoning, it may be accepted

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions