Packages

final case class TraceId(_traceId: Option[SpanId], _parentId: Option[SpanId], spanId: SpanId, _sampled: Option[Boolean], flags: Flags, traceIdHigh: Option[SpanId] = None) extends Product with Serializable

A trace id represents one particular trace for one request.

A request is composed of one or more spans, which are generally RPCs but may be other in-process activity. The TraceId for each span is a tuple of three ids:

  1. a shared id common to all spans in an overall request (trace id) 2. an id unique to this part of the request (span id) 3. an id for the parent request that caused this span (parent id)

For example, when service M calls service N, they may have respective TraceIds like these:

           TRACE ID         SPAN ID           PARENT ID
SERVICE M  e4bbb7c0f6a2ff07.a5f47e9fced314a2<:694eb2f05b8fd7d1
                  |                |
                  |                +-----------------+
                  |                                  |
                  v                                  v
SERVICE N  e4bbb7c0f6a2ff07.263edc9b65773b08<:a5f47e9fced314a2

Parent id and trace id are optional when constructing a TraceId because they are not present for the very first span in a request. In this case all three ids in the resulting TraceId are the same:

           TRACE ID         SPAN ID           PARENT ID
SERVICE A  34429b04b6bbf478.34429b04b6bbf478<:34429b04b6bbf478
_traceId

The low 64bits of the id for this request.

_parentId

The id for the request one step up the service stack.

spanId

The id for this particular request

_sampled

Should we sample this request or not? True means sample, false means don't, none means we defer decision to someone further down in the stack.

flags

Flags relevant to this request. Could be things like debug mode on/off. The sampled flag could eventually be moved in here.

traceIdHigh

The high 64bits of the id for this request, when the id is 128bits.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TraceId
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TraceId(_traceId: Option[SpanId], _parentId: Option[SpanId], spanId: SpanId, _sampled: Option[Boolean], flags: Flags)
  2. new TraceId(_traceId: Option[SpanId], _parentId: Option[SpanId], spanId: SpanId, _sampled: Option[Boolean], flags: Flags, traceIdHigh: Option[SpanId] = None)

    _traceId

    The low 64bits of the id for this request.

    _parentId

    The id for the request one step up the service stack.

    spanId

    The id for this particular request

    _sampled

    Should we sample this request or not? True means sample, false means don't, none means we defer decision to someone further down in the stack.

    flags

    Flags relevant to this request. Could be things like debug mode on/off. The sampled flag could eventually be moved in here.

    traceIdHigh

    The high 64bits of the id for this request, when the id is 128bits.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val _parentId: Option[SpanId]
  5. val _sampled: Option[Boolean]
  6. val _traceId: Option[SpanId]
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(other: Any): Boolean
    Definition Classes
    TraceId → Equals → AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. val flags: Flags
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def getSampled(): Option[Boolean]

    Java-friendly API to convert sampled to a Option of java.lang.Boolean.

    Java-friendly API to convert sampled to a Option of java.lang.Boolean.

    Since

    Java generics require objects, using sampled from Java would give an Option<Object> instead of Option<Boolean>

  15. def hashCode(): Int
    Definition Classes
    TraceId → AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def parentId: SpanId
  21. lazy val sampled: Option[Boolean]

    Override _sampled to Some(true) if the debug flag is set.

    Override _sampled to Some(true) if the debug flag is set.

    See also

    getSampled for a Java-friendly API.

  22. val spanId: SpanId
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    TraceId → AnyRef → Any
  25. def traceId: SpanId
  26. val traceIdHigh: Option[SpanId]
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped