Skip to content

Document trace- and session-level eval scope on the eval submission API#36873

Merged
cdfox merged 4 commits into
masterfrom
fox/eval-submission-trace-session-scope
May 22, 2026
Merged

Document trace- and session-level eval scope on the eval submission API#36873
cdfox merged 4 commits into
masterfrom
fox/eval-submission-trace-session-scope

Conversation

@cdfox
Copy link
Copy Markdown
Contributor

@cdfox cdfox commented May 20, 2026

What does this PR do? What is the motivation?

The eval submission API (/api/intake/llm-obs/v2/eval-metric) now supports trace-level and session-level evaluations via a new eval_scope field. This PR documents the new field and its behavior.

Changes:

  • Adds eval_scope and session_id to the EvalMetric reference table in the HTTP API reference
  • Updates join_on to reflect that it is now required only for span and trace scope (not session)
  • Updates the Evaluations API intro and scope description to cover all three levels
  • Expands JSON examples in both the API reference and external evaluations page to show span, trace, and session-scoped submissions

Merge instructions

Merge readiness:

  • Ready for merge

Additional notes

Backend changes: DataDog/dd-source#409393

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cdfox cdfox requested a review from a team as a code owner May 20, 2026 20:13
@github-actions
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

@brett0000FF brett0000FF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved but please see my comment about the paragraph that refers to the deleted tag.

- **`trace`**: Associates the evaluation with an entire trace, identified by `join_on` pointing to the root span.
- **`session`**: Associates the evaluation with a session, identified by `session_id`. Do not include `join_on` for session-scoped evaluations.

To submit evaluations for <a href="/llm_observability/instrumentation/otel_instrumentation">OpenTelemetry spans</a> directly to the Evaluations API, you must include the <code>source:otel</code> tag in the evaluation. Additionally, <code>span_id</code> and <code>trace_id</code> values must be provided as **decimal** strings. If your OpenTelemetry instrumentation produces hexadecimal IDs, convert them to decimal before submitting. For example, in Python: <code>str(int(hex_span_id, 16))</code>.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be removed since we removed source:otel from the example?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the Example section back to how it was originally. This was the first pass by claude that I pushed up here, so that I could get the preview links, but reviewing it now I think it's fine to just add a mention here about the new eval_scope field, with more details on the API page.

cdfox and others added 3 commits May 21, 2026 08:46
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s to API page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cdfox cdfox requested a review from brett0000FF May 21, 2026 13:14
@cdfox cdfox merged commit f8b18da into master May 22, 2026
24 checks passed
@cdfox cdfox deleted the fox/eval-submission-trace-session-scope branch May 22, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants