Span Attributes

Complete reference of all span attributes and tracing attributes.

Every span contains these fields regardless of log type. Fields are automatically populated when using the LLM Gateway, or you can set them manually via the logging endpoint.

For usage guides, see Log fields & parameters and Tracing parameters.

Input & Output

string / object / array — Universal input to the model. Required. Format depends on the log type.

string / object / array — Model’s response. Required. Format depends on the log type.

array — (Legacy) Messages sent to the model. Use input instead.

object — (Legacy) Final assistant message. Use output instead.

object — Complete request payload sent to the provider. Tool calls and function definitions are auto-extracted.

object — Full response object from the provider.

Metrics

string — Request start time in RFC3339 format (e.g. "2025-09-08T07:46:14.007279Z").

string — Request end time in RFC3339 format.

number — Total request latency in seconds.

number — Time to first token in seconds. Useful for measuring streaming responsiveness.

number — Output token throughput (tokens per second).

number — Total request cost in USD. Auto-calculated from model and token counts if omitted.

object — Token usage breakdown.

Sub-fieldTypeDescription
prompt_tokensintegerTokens in the prompt/input
completion_tokensintegerTokens in the model output
total_tokensintegerSum of prompt and completion tokens
prompt_tokens_detailsobjectGranular token breakdown (e.g., cached tokens)

integer — Number of tokens served from cache.

integer — Number of tokens added to cache.

integer — Reasoning tokens used (subset of completion_tokens). Applies to models with chain-of-thought reasoning (e.g., o3, gpt-5).

number — Time spent on routing/preprocessing in seconds.

number — Custom price per 1M prompt tokens. Use for self-hosted or fine-tuned models.

number — Custom price per 1M completion tokens.

Identifiers & metadata

string — Unique identifier for the log. Auto-generated if not provided.

string — Model name (e.g. "gpt-4o", "claude-3-5-sonnet-20240620"). Required.

string — Type of log. Defaults to "chat". See Log types.

string — Provider identifier (e.g. "openai", "anthropic").

string — Runtime environment (e.g. "test", "prod"). Used to separate test and production data.

string (max 254 characters) — User or customer-level identifier. Auto-truncated if exceeded. See Customer identifier.

object — Extended customer info: customer_identifier, name, email.

object — Custom key-value pairs for tagging, analytics, and filtering. All values are coerced to strings.

object — Typed metadata that preserves native types (numbers, booleans, nested objects). Unlike metadata, values are not coerced to strings.

string — Indexed custom identifier for fast querying.

string — Conversation thread identifier. Logs with the same value are grouped into a thread.

string — Group identifier for related logs.

string — Prompt template identifier. Auto-set when using prompt management.

string — Prompt template name.

integer — Prompt version number.

string — Deployment name.

string — API key identifier used for the request.

Tracing

stringRequired. Groups all spans into a single trace. All spans sharing this ID form one trace.

stringRequired. Unique identifier for this span within the trace.

string — Parent span ID. Creates the hierarchical tree structure. Omit or set to null for root spans.

string — Descriptive name for the operation (e.g. "openai.chat", "retrieval.search").

string — The nearest workflow this span belongs to. Used to label the root-level workflow in trace views.

string — Nested path within the workflow hierarchy.

string — Groups related traces together, even across different sessions or systems.

object — Additional Respan parameters passed via the tracing SDK.

Status & errors

integer — HTTP status code. Defaults to 200.

string — Semantic status: "success" or "error".

string — Error description if the request failed.

string / object — Non-fatal issues encountered during the request.

LLM configuration

number — Randomness control (0–2).

integer — Maximum number of tokens to generate.

number — Nucleus sampling parameter (0–1).

number — Penalizes tokens based on frequency (0–2).

number — Penalizes tokens already present (0–2).

array — Sequences that halt generation.

integer — Number of completions to generate.

boolean — Whether the response was streamed.

object — Output format: text, json_schema, or json_object.

array — Available tool/function definitions.

string / object — Controls tool selection: "none", "auto", or specific tool.

Annotations & Evaluation

boolean | null — User sentiment annotation. true = positive, false = negative, null = no annotation.

string — Annotation note text attached to the span.

object — Map of evaluator scores { evaluator_id: { evaluator_name, evaluator_slug, score_value } }. Sortable and filterable using the scores__ prefix pattern.

Other

array — Tools/functions called by the model in the response.

boolean — Whether the span is pinned (exempt from retention TTL deletion). Pinned spans are preserved indefinitely. Default: false.

boolean — Whether the span content is blurred for privacy (based on plan’s log retention limits).

boolean — When true, omits input/output messages from the log (metrics still recorded).

boolean — When true, adds detailed metrics (tokens, cost, latency) to the response body.

object — Logging behavior controls.

Sub-fieldTypeDescription
blockbooleanIf false, server returns immediately without awaiting log completion

Tracing attributes are a superset of Span Attributes. Every span attribute is also a tracing attribute, plus the fields below for building trace hierarchies and integrating with OpenTelemetry.

Trace hierarchy

stringRequired. Groups all spans into a single trace. All spans sharing this ID form one trace view.

stringRequired. Unique identifier for this span within the trace.

string — Parent span ID. Creates the hierarchical tree structure. Omit or set to null for root spans.

string — Descriptive name for the operation (e.g. "openai.chat", "retrieval.search", "generate_outline").

string — The workflow this span belongs to. Labels the root-level workflow in trace views.

string — Hierarchical path within the workflow (e.g. "content_pipeline.generate_outline"). Auto-set by the tracing SDK decorators.

string — Groups related traces together across sessions or systems.

OpenTelemetry semantic conventions

These attributes are set by tracing SDKs and auto-instrumentation libraries. Respan processes them from OTLP spans at ingestion.

GenAI conventions

AttributeDescription
gen_ai.systemProvider identifier ("openai", "anthropic", "google")
gen_ai.request.modelRequested model name
gen_ai.response.modelActual model used in response
gen_ai.request.temperatureTemperature setting
gen_ai.request.max_tokensMax tokens setting
gen_ai.usage.prompt_tokensPrompt/input token count
gen_ai.usage.completion_tokensCompletion/output token count
gen_ai.usage.cache_read_input_tokensCached input tokens
llm.request.typeRequest type ("chat", "completion", "embedding")
llm.usage.total_tokensTotal token count
llm.usage.reasoning_tokensReasoning tokens
llm.is_streamingWhether response was streamed

Traceloop conventions

AttributeDescription
traceloop.span.kindSpan type: "workflow", "task", "tool", "agent"
traceloop.entity.pathHierarchical span path
traceloop.entity.inputSpan input content
traceloop.entity.outputSpan output content
traceloop.workflow.nameWorkflow name

OpenInference conventions

OpenInference spans are auto-enriched by Respan into the GenAI/Traceloop equivalents above.

OpenInference AttributeMapped to
openinference.span.kindtraceloop.span.kind
llm.model_namegen_ai.request.model
llm.token_count.promptgen_ai.usage.prompt_tokens
llm.token_count.completiongen_ai.usage.completion_tokens
input.valuetraceloop.entity.input
output.valuetraceloop.entity.output

Respan-specific attributes

AttributeDescription
respan.customer_params.customer_identifierCustomer/user identifier
respan.threads.thread_identifierThread/conversation ID
respan.trace.trace_group_identifierGroup related traces
respan.metadataJSON metadata merged into span
respan.environmentEnvironment tag ("prod", "staging")
respan.entity.log_methodHow the span was created ("ts_tracing", "python_tracing", "logging_api")
respan.entity.log_typeSpan type for Respan processing

All Span Attributes

All fields from Span Attributes are also available on traced spans — including input/output, metrics, identifiers, metadata, status, LLM configuration, annotations, and evaluation scores.