Ends the span and records operation duration.
Optionalerror: unknownMarks the operation span and duration metric as failed.
Optionalexception: unknownSets a span attribute when the value is valid for OpenTelemetry.
Attaches common GenAI response metadata to the span.
Records GenAI token usage on the span and token usage metric.
Records a GenAI span plus operation duration and token usage metrics.