Skip to main content
A score records how well a run went. Attaching it through the SDK puts quality next to latency and cost on the same trace, so you can query all three together instead of joining an external evaluation store.

Score a trace or a span

score_trace / scoreTrace attaches the score to the trace’s root span. Use it for a judgement about the whole run. score attaches to the span you call it on. Use it when the judgement is about one step — a retrieval’s precision, a single tool call’s correctness. Every score must cite a Registry scorer artifact and immutable version. Eval resolves or creates that scorer automatically. For manual tracing, resolve the scorer once when the process starts and keep its id and version_ordinal.
Automatic first-run registration cannot detect a change to a local scorer function or judge prompt. Give a materially changed scorer a new Registry name and pass its new ID and version. Do not patch a scorer definition and assume the same version ordinal now represents immutable evidence.
score_trace targets the root span only when the SDK opened that root in the current context. Otherwise it falls back to the span it was called on, so the score is never silently dropped.

The three data types

Pass comment on any score to record why the value was assigned.

Invalid scores are dropped, not raised

Scoring never breaks the run. A score is dropped with a warning when the scorer ID is absent or malformed, the scorer version is absent or less than 1, the name is empty or not a string, the data type is unrecognized, a NUMERIC value is not numeric, a CATEGORICAL score has no string_value, or a BOOLEAN score has no value at all. That means a typo in a data type produces a missing score rather than an exception. If a score you expect is absent, enable ATLAN_DEBUG=true and check the warnings.

How a score is stored

Each score is a dedicated, immediately ended child span named score.{name}. It carries the numeric value, data type, scorer artifact ID, scorer version, and optional string value and comment as atlan.score.* attributes. This is why one evaluated case can legitimately contain several score spans. The score span’s parent defines its scope. score parents it to the span you call it on. score_trace parents it to the in-process root when that root can be resolved. Use a stable, lowercase score name with underscores so reporting aggregates the same measure across runs.

Where scores surface

Scores are written for the reporting surfaces, which is where you read them back alongside cost and latency — see Reporting. The management client’s trace and span reads return execution shape and usage totals rather than score values, so use reporting rather than registry_list_user_trace_spans when you want to compare scores across runs.

Next steps

Trace your agent

Spans, observation types, usage and cost.

Reporting

Where scores surface alongside cost and latency.