public class NoOpLLMObsSpan extends Object implements LLMObsSpan
| Modifier and Type | Field and Description |
|---|---|
static LLMObsSpan |
INSTANCE |
| Constructor and Description |
|---|
NoOpLLMObsSpan() |
| Modifier and Type | Method and Description |
|---|---|
void |
addThrowable(Throwable throwable)
Annotate the span with a throwable
|
void |
annotateIO(List<LLMObs.LLMMessage> inputData,
List<LLMObs.LLMMessage> outputData)
Annotate the span with inputs and outputs for LLM spans
|
void |
annotateIO(String inputData,
String outputData)
Annotate the span with inputs and outputs
|
void |
finish()
Finishes (closes) a span
|
long |
getSpanId()
Gets the SpanId.
|
DDTraceId |
getTraceId()
Gets the TraceId of the span's trace.
|
void |
setError(boolean error)
Annotate the span to indicate that an error occurred
|
void |
setErrorMessage(String errorMessage)
Annotate the span with an error message
|
void |
setMetadata(Map<String,Object> metadata)
Annotate the span with metadata
|
void |
setMetric(CharSequence key,
double value)
Annotate the span with a single metric key value pair for the span’s context (number of tokens
document length, etc).
|
void |
setMetric(CharSequence key,
int value)
Annotate the span with a single metric key value pair for the span’s context (number of tokens
document length, etc).
|
void |
setMetric(CharSequence key,
long value)
Annotate the span with a single metric key value pair for the span’s context (number of tokens
document length, etc).
|
void |
setMetrics(Map<String,Number> metrics)
Annotate the span with metrics
|
void |
setTag(String key,
boolean value)
Annotate the span with a single tag key value pair as a tag regarding the span’s context
(session, environment, system, versioning, etc.).
|
void |
setTag(String key,
double value)
Annotate the span with a single tag key value pair as a tag regarding the span’s context
(session, environment, system, versioning, etc.).
|
void |
setTag(String key,
int value)
Annotate the span with a single tag key value pair as a tag regarding the span’s context
(session, environment, system, versioning, etc.).
|
void |
setTag(String key,
long value)
Annotate the span with a single tag key value pair as a tag regarding the span’s context
(session, environment, system, versioning, etc.).
|
void |
setTag(String key,
String value)
Annotate the span with a single tag key value pair as a tag regarding the span’s context
(session, environment, system, versioning, etc.).
|
void |
setTags(Map<String,Object> tags)
Annotate the span with tags
|
public static final LLMObsSpan INSTANCE
public void annotateIO(List<LLMObs.LLMMessage> inputData, List<LLMObs.LLMMessage> outputData)
LLMObsSpanannotateIO in interface LLMObsSpaninputData - The input messages of the span in the form of a listoutputData - The output messages of the span in the form of a listpublic void annotateIO(String inputData, String outputData)
LLMObsSpanannotateIO in interface LLMObsSpaninputData - The input data of the span in the form of a stringoutputData - The output data of the span in the form of a stringpublic void setMetadata(Map<String,Object> metadata)
LLMObsSpansetMetadata in interface LLMObsSpanmetadata - A map of JSON serializable key-value pairs that contains metadata information
relevant to the input or output operation described by the spanpublic void setMetrics(Map<String,Number> metrics)
LLMObsSpansetMetrics in interface LLMObsSpanmetrics - A map of JSON serializable keys and numeric values that users can add as metrics
relevant to the operation described by the span (input_tokens, output_tokens, total_tokens,
etc.).public void setMetric(CharSequence key, int value)
LLMObsSpansetMetric in interface LLMObsSpankey - the name of the metricvalue - the value of the metricpublic void setMetric(CharSequence key, long value)
LLMObsSpansetMetric in interface LLMObsSpankey - the name of the metricvalue - the value of the metricpublic void setMetric(CharSequence key, double value)
LLMObsSpansetMetric in interface LLMObsSpankey - the name of the metricvalue - the value of the metricpublic void setTags(Map<String,Object> tags)
LLMObsSpansetTags in interface LLMObsSpantags - An map of JSON serializable key-value pairs that users can add as tags regarding
the span’s context (session, environment, system, versioning, etc.).public void setTag(String key, String value)
LLMObsSpansetTag in interface LLMObsSpankey - the key of the tagvalue - the value of the tagpublic void setTag(String key, boolean value)
LLMObsSpansetTag in interface LLMObsSpankey - the key of the tagvalue - the value of the tagpublic void setTag(String key, int value)
LLMObsSpansetTag in interface LLMObsSpankey - the key of the tagvalue - the value of the tagpublic void setTag(String key, long value)
LLMObsSpansetTag in interface LLMObsSpankey - the key of the tagvalue - the value of the tagpublic void setTag(String key, double value)
LLMObsSpansetTag in interface LLMObsSpankey - the key of the tagvalue - the value of the tagpublic void setError(boolean error)
LLMObsSpansetError in interface LLMObsSpanerror - whether an error occurredpublic void setErrorMessage(String errorMessage)
LLMObsSpansetErrorMessage in interface LLMObsSpanerrorMessage - the message of the errorpublic void addThrowable(Throwable throwable)
LLMObsSpanaddThrowable in interface LLMObsSpanthrowable - the errored throwablepublic void finish()
LLMObsSpanfinish in interface LLMObsSpanpublic DDTraceId getTraceId()
LLMObsSpangetTraceId in interface LLMObsSpanDDTraceId.ZERO if not set.public long getSpanId()
LLMObsSpangetSpanId in interface LLMObsSpan