Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Attribute keys

Reference for the public judgment.* span attribute keys Judgment accepts as attribute-mapper targets.

Judgment reads the following public judgment.* OpenTelemetry span attributes as structured fields. The Judgeval SDKs set them for you. Use this reference when you add attributes manually, export raw OpenTelemetry spans, or choose a target for an attribute mapper.

Attributes that use other keys remain stored and searchable as custom attributes.

Core

Control how a span is displayed in the trace view.

Attribute keyDescription
judgment.inputThe input a step receives.
judgment.outputThe output a step produces.
judgment.llm.tool_callsStructured tool/function calls made during a step.
judgment.span_kindThe type of step (`llm`, `tool`, `function`, `agent`, ...). Judgment infers this automatically when usage or provider/model attributes are present, so you rarely need to set it yourself.
judgment.span_nameThe name shown for this step in the trace. Falls back to the raw OpenTelemetry span name when unset.
judgment.agent_versionThe version of the agent or prompt implementation used for this step. Powers the agent-version breakdown in monitoring.

Identifiers

Group traces so they can be filtered and broken down in monitoring.

Attribute keyDescription
judgment.session_idTies multiple traces to one conversation or session. Map here to view all of a user's requests together.
judgment.customer_idWhich of your customers (tenant/account) a trace belongs to. Map here to filter and break down activity by customer.
judgment.customer_user_idWhich individual end user a trace belongs to. Map here to trace activity down to a single user.

Usage & Cost

Judgment prices a span from its provider, model, and token counts. If you already have a cost figure, set judgment.usage.total_cost_usd instead.

Attribute keyDescription
judgment.llm.providerThe model provider, e.g. OpenAI or Anthropic. Map here so Judgment can price token usage accurately.
judgment.llm.modelThe exact model used, e.g. gpt-4o. Map here (together with provider) so cost is calculated correctly.
judgment.usage.non_cached_input_tokensInput tokens charged at the normal (uncached) rate. Map here to report input token cost.
judgment.usage.cache_creation_input_tokensInput tokens written into the prompt cache. Map here to track prompt-cache write cost.
judgment.usage.reasoning_tokensTokens a reasoning model spends "thinking". Map here to account for reasoning cost.
judgment.usage.cache_read_input_tokensInput tokens read from the prompt cache at the cheaper cached rate. Map here to track cache savings.
judgment.usage.output_tokensTokens the model generated in its response. Map here to report output token cost.
judgment.usage.non_cached_input_image_tokensImage input tokens charged at the normal rate. Map here if your model bills image inputs separately.
judgment.usage.output_image_tokensImage tokens the model generated. Map here if your model bills image outputs separately.
judgment.usage.total_cost_usdA total cost you have already computed for this step, in USD. Map here to report cost directly instead of from tokens.

Was this page helpful?