dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

LLMObs retrieval and embedding span creation methods are not static

Open ClintAtEsper opened this issue 6 months ago • 1 comments

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);

  }
}

ClintAtEsper avatar Aug 15 '25 23:08 ClintAtEsper

This issue is being addressed in https://github.com/DataDog/dd-trace-java/pull/9395

nayeem-kamal avatar Aug 26 '25 14:08 nayeem-kamal