TracingStateinterface
Properties (20)
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| addEvent⚓︎ | ( name: string, attributesOrStartTime?: Attributes | TimeInput, startTime?: TimeInput ) => this | x | x | |
| addLink⚓︎ | (link: Link) => this | x | Adds a link to another span - for a link that could not be given at creation, such as a
parent's link to a child. Until the span ends. On a span recorded by the
|
|
| autoSetSuccessStatus⚓︎ | boolean | x | x |
|
| context⚓︎ | Context | x | x | x |
| enabled⚓︎ | boolean | x | If false, this is a placeholder object, and all its methods are no-ops, with the possible exception of getPropagationInfo() and injectPropagationInfo() |
|
| endTime⚓︎ | Date | x | x | x |
| getPropagationInfo⚓︎ | () => PropagationInfo | null | x | Gets the propagation info for the current span (see https://www.w3.org/TR/trace-context/#tracestate-field) |
|
| id⚓︎ | string | x | x | x |
| injectPropagationInfo⚓︎ | (carrier: PropagationInfoCarrier & object) => void | x | Sets a hidden property in the object that can be used to restore propagation information after serialization and deserialization (see withSpan 'propagationInfo' argument and Traces.extractPropagationInfo() method). |
|
| isRecording⚓︎ | Span["isRecording"] | x | x | |
| level⚓︎ | keyof typeof SpanVerbosity | x | x | |
| matchingFilter⚓︎ | SpanFilter | null | x | x | x |
| recordException⚓︎ | Span["recordException"] | x | x | |
| source⚓︎ | string | x | x | |
| span⚓︎ | Span | x | x | x |
| spanContext⚓︎ | () => ReturnType<Span["spanContext"]> | undefined | x | The context of the span - what a link to it is made with - or |
|
| startTime⚓︎ | Date | x | x | x |
| status⚓︎ | SpanStatus | x | x | x |
| traceId⚓︎ | string | x | x | x |
| updateName⚓︎ | (name: string) => this | x | x |
3 Methods
addData()⚓︎
(level: SpanVerbosity | keyof typeof SpanVerbosity, data: object | (() => object)) => void
Adds data to the span - as attributes, flattened - when the span records the given
verbosity level: a level at or above the span's own level.
data given as a function is computed lazily: the function is called only when the
span records the level, once, so a value that is expensive to work out costs nothing on
a span that does not record it - or on a disabled span, which never calls it. A function
that throws is handled like any other error inside the library: swallowed (and logged)
in errorlessMode, thrown to the caller otherwise; one that returns nothing adds
nothing.
On a span of the startup span buffer (BufferingTracesManager) the level is not known
yet: the function is kept and called when the span is replayed into the real manager -
once, and only if the span records the level - so it should not depend on state that
changes in the meantime. A function that throws at the replay is logged, and its data
left out.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| level⚓︎ | SpanVerbosity | keyof typeof SpanVerbosity | x | |
| data⚓︎ | object | (() => object) | x |