Skip to content

Java SDK: document embedding/retrieval annotation - #39036

Closed
ebrevan wants to merge 1 commit into
masterfrom
dd/edgardo/java-llmobs-document-annotation-20260810
Closed

Java SDK: document embedding/retrieval annotation#39036
ebrevan wants to merge 1 commit into
masterfrom
dd/edgardo/java-llmobs-document-annotation-20260810

Conversation

@ebrevan

@ebrevan ebrevan commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do? What is the motivation?

Adds documentation for two new Java SDK methods, annotateEmbeddingIO() and annotateRetrievalIO(), introduced in dd-trace-java#12149. These methods let customers annotate embedding and retrieval spans with structured document objects (LLMObs.Document) rather than plain strings, giving the trace view richer context for those span types.

The changes land in the Java tab of Enriching spans > Annotating inputs and outputs in the LLM Observability SDK reference page.

Changes:

  • Updates the section intro to cover all three annotation methods and states which span kind each targets.
  • Renames the existing #### Arguments heading to #### annotateIO() arguments for clarity.
  • Adds #### annotateEmbeddingIO() arguments and #### annotateRetrievalIO() arguments subsections, each documenting its parameters and preserving the existing null/empty-argument behavior guidance.
  • Adds a #### Documents subsection documenting how to construct LLMObs.Document values (required text; optional name, id, score), parallel to the existing #### LLM Messages subsection.
  • Expands #### Example to #### Examples and adds concise embedding-span and retrieval-span code examples alongside the existing LLM-span example.
  • Notes that annotateEmbeddingIO() and annotateRetrievalIO() require dd-trace-java 1.66.0 or later.

Merge readiness

  • Ready for merge

For Datadog employees:

  • ⚠️ Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). If you've already created your PR with an incorrect branch name, please rename your branch and open a fresh PR.
  • 🤖 New: Comment with /review to run an automated check that catches common issues before a Documentation team member reviews your PR.

AI assistance

Used Claude Code (Bits Code) to draft, structure, and write the documentation changes.

Additional notes

Source PR: DataDog/dd-trace-java#12149

NOTE: some AI-generated links and images were removed to ensure safety.


PR by Bits - View session in Datadog

Comment @datadog-staging to request changes

… Observability SDK

Co-authored-by: ebrevan <104702479+ebrevan@users.noreply.github.com>
@datadog-staging

datadog-staging Bot commented Aug 10, 2026

Copy link
Copy Markdown

View session in Datadog

Bits Code status: ✅ Done

Comment @datadog-staging to request changes

@datadog-staging

Copy link
Copy Markdown

I can only run on private repositories.

@github-actions

Copy link
Copy Markdown
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@ebrevan ebrevan closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant