dd-trace-java
dd-trace-java copied to clipboard
LLMObs retrieval and embedding span creation methods are not static
Tracer Version(s)
1.52.1
Java Version(s)
21.0.8
JVM Vendor
Eclipse Adoptium / Temurin
Bug Report
The most recent PR to add the retrieval and embeddings span types for LLM Observability did not make the span creation methods static like the other span creation methods - LLMObs.startWorkflowSpan, etc.
Expected Behavior
LLMObs.startRetrievalSpan and LLMObs.startEmbeddingSpan are available without needing to manually attempt to instantiate the LLMObs class.
Reproduction Code
This won't compile unless you comment out the retrieval span.
import datadog.trace.api.llmobs.LLMObs;
import datadog.trace.api.llmobs.LLMObsSpan;
public class Obs {
public void main (String[] args) {
LLMObsSpan llmWorkflowSpan = LLMObs.startWorkflowSpan("main", "test-app", null);
LLMObsSpan llmRetrievalSpan = LLMObs.startRetrievalSpan("main", "test-app", null);
}
}
This issue is being addressed in https://github.com/DataDog/dd-trace-java/pull/9395