this for fluent chaining.
Methods
constructor(span: Span)
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.
An Error instance or error message string.
setAttribute(key: string, value: string | number | boolean): this
Set an arbitrary attribute on the span.
Attribute key (e.g.
"gen_ai.request.model").Attribute value.
return
this for chaining.setConversationId(id: string): this
Tag this span with a conversation/session identifier.
Unique conversation or session ID.
return
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.
The input value (string or serializable object).
return
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.
The output value (string or serializable object).
return
this for chaining.