TraceContext

org.llm4s.trace.TraceContext
See theTraceContext companion class
object TraceContext

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply(traceId: String, spanId: String, sampled: Boolean): TraceContext

Throws IllegalArgumentException for an invalid id; use of for untrusted input.

Throws IllegalArgumentException for an invalid id; use of for untrusted input.

Attributes

def of(traceId: String, spanId: String, sampled: Boolean): Result[TraceContext]

A context with these ids, or a ValidationError naming what is wrong with them. Upper-case hex is lower-cased.

A context with these ids, or a ValidationError naming what is wrong with them. Upper-case hex is lower-cased.

Attributes

def parse(traceParent: String): Result[TraceContext]

Reads a W3C traceparent value: <version>-<traceId>-<spanId>-<flags>, two hex digits of version (not ff) and of flags, whose lowest bit is the sampled flag. A version above 00 may carry more fields after the flags, which are ignored, as the W3C specification asks.

Reads a W3C traceparent value: <version>-<traceId>-<spanId>-<flags>, two hex digits of version (not ff) and of flags, whose lowest bit is the sampled flag. A version above 00 may carry more fields after the flags, which are ignored, as the W3C specification asks.

Attributes

A context with a new random trace and span, sampled.

A context with a new random trace and span, sampled.

Attributes

def rootFor(key: String): TraceContext

The root context key names: a trace id and a span id both derived from key (a SHA-256), sampled. For a unit of work whose trace must be computed the same way by several parties without one of them choosing it at random: the same key always names the same trace.

The root context key names: a trace id and a span id both derived from key (a SHA-256), sampled. For a unit of work whose trace must be computed the same way by several parties without one of them choosing it at random: the same key always names the same trace.

Attributes

Givens

Givens