Skip to content

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 ParameterDefault type
T extends SpanTypeSpanType

Properties

PropertyModifierTypeDefined in
idreadonlystringpackages/core/src/contracts/tracer.ts:134
parentId?readonlystringpackages/core/src/contracts/tracer.ts:136
traceIdreadonlystringpackages/core/src/contracts/tracer.ts:135
typereadonlyTpackages/core/src/contracts/tracer.ts:133

Methods

addEvent()

ts
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

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:152

End the span. Idempotent.

Returns

void


recordException()

ts
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

ParameterType
errunknown

Returns

void


setAttributes()

ts
setAttributes(attrs): void;

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

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:150

Set the terminal status.

Parameters

ParameterType
statusSpanStatus
message?string

Returns

void