Skip to content

Graphorin API reference v0.15.1


Graphorin API reference / @graphorin/core / / AISpan

Interface: AISpan<T> ​

Defined in: packages/core/src/contracts/tracer.ts:135

Stable

Typed span. Generic over SpanType so consumers can specialize a function on a particular span kind without losing the discriminator.

Extended by ​

Type Parameters ​

Type ParameterDefault type
T extends SpanTypeSpanType

Properties ​

PropertyModifierTypeDefined in
idreadonlystringpackages/core/src/contracts/tracer.ts:137
parentId?readonlystringpackages/core/src/contracts/tracer.ts:139
traceIdreadonlystringpackages/core/src/contracts/tracer.ts:138
typereadonlyTpackages/core/src/contracts/tracer.ts:136

Methods ​

addEvent() ​

ts
addEvent(
   name, 
   attrs?, 
   opts?): void;

Defined in: packages/core/src/contracts/tracer.ts:149

Append a span event (attribute-bearing time-stamped marker). The optional opts 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 ​

ParameterType
namestring
attrs?Readonly<Record&lt;string, SpanAttributeValue&gt;>
opts?AddEventOptions

Returns ​

void


end() ​

ts
end(): void;

Defined in: packages/core/src/contracts/tracer.ts:155

End the span. Idempotent.

Returns ​

void


recordException() ​

ts
recordException(err): void;

Defined in: packages/core/src/contracts/tracer.ts:151

Record an exception. Multiple calls are kept in the span event log.

Parameters ​

ParameterType
errunknown

Returns ​

void


setAttributes() ​

ts
setAttributes(attrs): void;

Defined in: packages/core/src/contracts/tracer.ts:141

Add or replace attributes. Repeated calls are merged (last write wins).

Parameters ​

ParameterType
attrsSpanAttributes

Returns ​

void


setStatus() ​

ts
setStatus(status, message?): void;

Defined in: packages/core/src/contracts/tracer.ts:153

Set the terminal status.

Parameters ​

ParameterType
statusSpanStatus
message?string

Returns ​

void