Repository navigation
docs(agent-tracing): document evaluation spans for JS and Python #19825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ArthurKnaus
merged 1 commit into
master
from
arthurknaus/tet-3057-agent-evaluation-spans
Oct 8, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| Describes an evaluation of generated content against a set of questions (for example a TypeSafe Jev evaluation). | ||
|
|
||
| - The span `op` (transaction mode) or the span's `sentry.op` attribute (stream mode) MUST be `"gen_ai.evaluate"`. | ||
| - The span `name` SHOULD be `"evaluate {gen_ai.request.model}"`. (e.g. `"evaluate typesafe/jev-1.13"`) | ||
| - The `gen_ai.operation.name` attribute MUST be `"evaluate"`. Sentry uses this attribute, not the span `op`, to tell evaluations apart from ordinary LLM calls (both share the `ai_client` operation type). | ||
| - The `gen_ai.request.model` attribute SHOULD be the requested evaluation model. (e.g. `"typesafe/jev-1.13"`) | ||
| - The `gen_ai.response.model` attribute SHOULD be the concrete model that responded. (e.g. `"typesafe/jev-1.13-20260917"`) | ||
| - The `gen_ai.provider.name` attribute SHOULD be set to the provider. (e.g. `"typesafe"`) | ||
| - The `gen_ai.agent.name` attribute SHOULD be set to the agent's name when the evaluation runs under an agent. (e.g. `"Support Agent"`) | ||
|
|
||
| Additional attributes on the span: | ||
|
|
||
| | Data Attribute | Type | Requirement Level | Description | Example | | ||
| | :--------------------------- | :----- | :---------------- | :------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------- | | ||
| | `gen_ai.input.messages` | string | optional | A single evaluation object holding the evaluated `state` and the `questions` (stringified JSON). **[0]** | `'[{"type": "evaluation", "state": "...", "questions": {"accuracy": {"type": "score", "criteria": ["incorrect", "correct"]}}}]'` | | ||
| | `gen_ai.output.messages` | string | optional | A single evaluation object holding the `answers`, keyed by the same question keys (stringified JSON). **[1]** | `'[{"type": "evaluation", "answers": {"accuracy": {"type": "score", "score": 1}}}]'` | | ||
| | `gen_ai.usage.input_tokens` | int | optional | The number of tokens used in the evaluation input. | `154` | | ||
| | `gen_ai.usage.output_tokens` | int | optional | The number of tokens used in the evaluation output. | `28` | | ||
|
|
||
| **[0]** Each entry in `questions` has an `instructions` string and a `type`. For a `score` question, `criteria` is an ordered string array whose index is the score (`["low", "medium", "high"]`). For a `choice` question, `criteria` maps each label to its description (`{"positive": "...", "negative": "..."}`). | ||
|
|
||
| **[1]** Each answer carries a `type` that matches its question: | ||
|
|
||
| | Answer `type` | Fields | | ||
| | :------------ | :---------------------------------------------------------------------------------- | | ||
| | `boolean` | `probability` | | ||
| | `noul` | `noul` holds the probability (Jev's variant of `boolean`). | | ||
| | `score` | `score`, plus optional `legend` (`{"0": "low"}`), `probabilities`, and `confidence` | | ||
| | `choice` | `choice`, plus optional `probabilities` and `confidence` | | ||
|
|
||
| Optional fields may be omitted, but a field present with the wrong type makes that question or answer unreadable and it's shown raw in the span detail. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this conflict with the whole evaluate vs evaluation thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it is a bit confusing...
getsentry/sentry-conventions#650 added the conventions