Package datadog.trace.api.llmobs.noop
Class NoOpLLMObsSpan
java.lang.Object
datadog.trace.api.llmobs.noop.NoOpLLMObsSpan
- All Implemented Interfaces:
LLMObsSpan
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddThrowable(Throwable throwable) Annotate the span with a throwablevoidannotateIO(String inputData, String outputData) Annotate the span with inputs and outputsvoidannotateIO(List<LLMObs.LLMMessage> inputData, List<LLMObs.LLMMessage> outputData) Annotate the span with inputs and outputs for LLM spansvoidfinish()Finishes (closes) a spanlongGets the SpanId.Gets the TraceId of the span's trace.voidsetError(boolean error) Annotate the span to indicate that an error occurredvoidsetErrorMessage(String errorMessage) Annotate the span with an error messagevoidsetMetadata(Map<String, Object> metadata) Annotate the span with metadatavoidsetMetric(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).voidsetMetric(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).voidsetMetric(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).voidsetMetrics(Map<String, Number> metrics) Annotate the span with metricsvoidAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).voidAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).voidAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).voidAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).voidAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).voidAnnotate the span with tags
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NoOpLLMObsSpan
public NoOpLLMObsSpan()
-
-
Method Details
-
annotateIO
Description copied from interface:LLMObsSpanAnnotate the span with inputs and outputs for LLM spans- Specified by:
annotateIOin interfaceLLMObsSpan- Parameters:
inputData- The input messages of the span in the form of a listoutputData- The output messages of the span in the form of a list
-
annotateIO
Description copied from interface:LLMObsSpanAnnotate the span with inputs and outputs- Specified by:
annotateIOin interfaceLLMObsSpan- Parameters:
inputData- The input data of the span in the form of a stringoutputData- The output data of the span in the form of a string
-
setMetadata
Description copied from interface:LLMObsSpanAnnotate the span with metadata- Specified by:
setMetadatain interfaceLLMObsSpan- Parameters:
metadata- A map of JSON serializable key-value pairs that contains metadata information relevant to the input or output operation described by the span
-
setMetrics
Description copied from interface:LLMObsSpanAnnotate the span with metrics- Specified by:
setMetricsin interfaceLLMObsSpan- Parameters:
metrics- 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.).
-
setMetric
Description copied from interface:LLMObsSpanAnnotate the span with a single metric key value pair for the span’s context (number of tokens document length, etc).- Specified by:
setMetricin interfaceLLMObsSpan- Parameters:
key- the name of the metricvalue- the value of the metric
-
setMetric
Description copied from interface:LLMObsSpanAnnotate the span with a single metric key value pair for the span’s context (number of tokens document length, etc).- Specified by:
setMetricin interfaceLLMObsSpan- Parameters:
key- the name of the metricvalue- the value of the metric
-
setMetric
Description copied from interface:LLMObsSpanAnnotate the span with a single metric key value pair for the span’s context (number of tokens document length, etc).- Specified by:
setMetricin interfaceLLMObsSpan- Parameters:
key- the name of the metricvalue- the value of the metric
-
setTags
Description copied from interface:LLMObsSpanAnnotate the span with tags- Specified by:
setTagsin interfaceLLMObsSpan- Parameters:
tags- An map of JSON serializable key-value pairs that users can add as tags regarding the span’s context (session, environment, system, versioning, etc.).
-
setTag
Description copied from interface:LLMObsSpanAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).- Specified by:
setTagin interfaceLLMObsSpan- Parameters:
key- the key of the tagvalue- the value of the tag
-
setTag
Description copied from interface:LLMObsSpanAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).- Specified by:
setTagin interfaceLLMObsSpan- Parameters:
key- the key of the tagvalue- the value of the tag
-
setTag
Description copied from interface:LLMObsSpanAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).- Specified by:
setTagin interfaceLLMObsSpan- Parameters:
key- the key of the tagvalue- the value of the tag
-
setTag
Description copied from interface:LLMObsSpanAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).- Specified by:
setTagin interfaceLLMObsSpan- Parameters:
key- the key of the tagvalue- the value of the tag
-
setTag
Description copied from interface:LLMObsSpanAnnotate the span with a single tag key value pair as a tag regarding the span’s context (session, environment, system, versioning, etc.).- Specified by:
setTagin interfaceLLMObsSpan- Parameters:
key- the key of the tagvalue- the value of the tag
-
setError
public void setError(boolean error) Description copied from interface:LLMObsSpanAnnotate the span to indicate that an error occurred- Specified by:
setErrorin interfaceLLMObsSpan- Parameters:
error- whether an error occurred
-
setErrorMessage
Description copied from interface:LLMObsSpanAnnotate the span with an error message- Specified by:
setErrorMessagein interfaceLLMObsSpan- Parameters:
errorMessage- the message of the error
-
addThrowable
Description copied from interface:LLMObsSpanAnnotate the span with a throwable- Specified by:
addThrowablein interfaceLLMObsSpan- Parameters:
throwable- the errored throwable
-
finish
public void finish()Description copied from interface:LLMObsSpanFinishes (closes) a span- Specified by:
finishin interfaceLLMObsSpan
-
getTraceId
Description copied from interface:LLMObsSpanGets the TraceId of the span's trace.- Specified by:
getTraceIdin interfaceLLMObsSpan- Returns:
- The TraceId of the span's trace, or
DDTraceId.ZEROif not set.
-
getSpanId
public long getSpanId()Description copied from interface:LLMObsSpanGets the SpanId.- Specified by:
getSpanIdin interfaceLLMObsSpan- Returns:
- The span identifier.
-