Skip to main content
Base wrapper around an OpenTelemetry Span with Fiddler-specific attribute helpers. All setter methods return this for fluent chaining.

Methods

constructor(span: 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.
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.
key
string
required
Attribute key (e.g. "gen_ai.request.model").
value
string | number | boolean
required
Attribute value.
return
this for chaining.

setConversationId(id: string): this

Tag this span with a conversation/session identifier.
id
string
required
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.
input
unknown
required
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.
output
unknown
required
The output value (string or serializable object).
return
this for chaining.