this for fluent chaining.
Methods
constructor(span: Span)
Span
required
The underlying OpenTelemetry span instance.
end()
Mark the span as successful and record its end timestamp.
recordError(error: string | Error)
Record an error on this span and set its status to ERROR.
string | Error
required
An Error instance or error message string.
setAttribute(key: string, value: string | number | boolean): this
Set an arbitrary attribute on the span.
string
required
Attribute key (e.g.
"gen_ai.request.model").string | number | boolean
required
Attribute value.
this for chaining.setConversationId(id: string): this
Tag this span with a conversation/session identifier.
string
required
Unique conversation or session ID.
this for chaining.setInput(input: unknown): this
Set the user-facing input for this span.
Writes to the gen_ai.llm.input.user attribute after safely
serializing non-string values.
unknown
required
The input value (string or serializable object).
this for chaining.setOutput(output: unknown): this
Set the output/response for this span.
Writes to the gen_ai.llm.output attribute after safely
serializing non-string values.
unknown
required
The output value (string or serializable object).
this for chaining.