Skip to content

Rule proposal: Only one purpose per span #42

@AlexanderWert

Description

@AlexanderWert

Proposal

Rule ID:

SPA-...

Description:
A single span in a trace should not have more than one purpose (i.e. implicit SpanKind).

For example, a span of SpanKind SERVER or CONSUMER should not at the same time represent an "exit-span" (i.e. a span that usually would have the SpanKind CLIENT or PRODUCER). Thus, such a span SHOULD NOT have child spans that belong to a different service. (For that kind of situation the instrumentation should create a dedicated span that represent the CLIENT span for the outgoing call to the other service).

Rationale:
Mixing server/client or producer/consumer semantics in a single span makes it difficult to interpret the span’s purpose and causes backend analysis problems, as SpanKind only has one value. This may lead to hidden or implicit meanings, complicating metrics aggregation and trace interpretation.

Target: Span

Criteria:

  • A span of SpanKind SERVER or CONSUMER does not have children that belong to a different service
  • A span of SpanKind CLIENT or PRODUCER does not have a parent that belongs to a different service

Impact: IMPORTANT

Type:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions