Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/core / / AISpan
Interface: AISpan<T>
Defined in: packages/core/src/contracts/tracer.ts:132
Typed span. Generic over SpanType so consumers can specialize a function on a particular span kind without losing the discriminator.
Stable
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends SpanType | SpanType |
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
id | readonly | string | packages/core/src/contracts/tracer.ts:134 |
parentId? | readonly | string | packages/core/src/contracts/tracer.ts:136 |
traceId | readonly | string | packages/core/src/contracts/tracer.ts:135 |
type | readonly | T | packages/core/src/contracts/tracer.ts:133 |
Methods
addEvent()
addEvent(
name,
attrs?,
opts?): void;Defined in: packages/core/src/contracts/tracer.ts:146
Append a span event (attribute-bearing time-stamped marker). The optional opts (W-094) tags the event's attributes with a sensitivity tier so the validation exporter can pass safe ones through the default-deny floor - untagged attributes keep being dropped below the floor.
Parameters
| Parameter | Type |
|---|---|
name | string |
attrs? | Readonly<Record<string, SpanAttributeValue>> |
opts? | AddEventOptions |
Returns
void
end()
end(): void;Defined in: packages/core/src/contracts/tracer.ts:152
End the span. Idempotent.
Returns
void
recordException()
recordException(err): void;Defined in: packages/core/src/contracts/tracer.ts:148
Record an exception. Multiple calls are kept in the span event log.
Parameters
| Parameter | Type |
|---|---|
err | unknown |
Returns
void
setAttributes()
setAttributes(attrs): void;Defined in: packages/core/src/contracts/tracer.ts:138
Add or replace attributes. Repeated calls are merged (last write wins).
Parameters
| Parameter | Type |
|---|---|
attrs | SpanAttributes |
Returns
void
setStatus()
setStatus(status, message?): void;Defined in: packages/core/src/contracts/tracer.ts:150
Set the terminal status.
Parameters
| Parameter | Type |
|---|---|
status | SpanStatus |
message? | string |
Returns
void