Skip to content

ADR-41 tracing - disabling tracing by rewriting traceparent to Xraceparent #392

@roeschter

Description

@roeschter

Setting the traceparent header (usually by a client) enables tracing. In some situation tracing needs to be disabled
For performance reasons the disabling is done by a single character replacement (avoiding a parsen and render header cycle) from traceparent to Xraceparent - This is an undocumented oddity from the end users perspctive.

Situations in which traceparent is disabled

  1. When storing in a stream
  2. Cross account service export unless tracing is explicitely enabled by the export
  3. If only “traceparent” header is found (that is, "Nats-Trace-Dest” is not) and the trace should not be sampled. That is, the account has a sampling value (between 0..100) and the server picks a random number, if below the sampling value the message will be traced, otherwise it will not. In that case, the header is “disabled” (with the “X”).

Case 2) Is not a security feature
Case 3) It is natural to expect that the header is removed is mangled

Problem:
Case 1) Is unexpected and counter-intuitive
a) Unexpected - The consumer is the one interested in the tracing data. But it will not know it was traced as traceparent has been mangled.
b) Why is delivery not traced? One would expect to see the message trace end-2-end. Including source/mirror and consumption.

Suggestion:
Do NOT disable tracing when storing in a stream. Continue tracing all the way through to the consumer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions