Trace attributes
Runtype reads HTTP headers, resource attributes, and span attributes from incoming OpenTelemetry Protocol (OTLP) over HTTP trace and log exports. This page lists each header and attribute, where to set it, its accepted values, what it does, and what happens when it’s absent.
Minimum attributes
Set these attributes to populate runs and pass the first-trace check, which checks attribution, content, system_prompt, tool_definitions, tool_io, conversation_id, environment, and end_user_id (optional):
gen_ai.operation.nameon agent, model, and tool spansgen_ai.agent.namegen_ai.request.modelgen_ai.usage.input_tokensandgen_ai.usage.output_tokensgen_ai.conversation.iduser.idgen_ai.input.messages,gen_ai.system_instructions,gen_ai.output.messages,gen_ai.tool.definitions,gen_ai.tool.call.arguments, andgen_ai.tool.call.resultdeployment.environment.name
HTTP headers
The following table lists the HTTP headers that Runtype reads on requests to /v1/otel/v1/traces and /v1/otel/v1/logs:
With a telemetry API key, Runtype accepts requests to /v1/otel/v1/metrics with 200 and doesn’t store metric data. A product ingest key returns 403.
Agent attribution
The following table lists the attributes that determine which Runtype agent receives a trace or log export:
Attribution precedence and limits
Runtype resolves agent ownership by credential and signal:
- Telemetry API key: Checks the
runtype.agent.idresource attribute, then thex-runtype-agent-idheader, and thenruntype.agent.idon aninvoke_agentor parentless root span. Without any of these, Runtype rejects the trace with400(missing_agent_attribution). Conflictingruntype.agent.idresource attributes, or conflictingruntype.agent.idspan attributes without a resource attribute or header, reject the trace withambiguous_agent_attribution. - Product ingest key: Checks
runtype.agent.id(resource attribute, theninvoke_agentor parentless root span), then span agent name (runtype.agent.name, thengen_ai.agent.name, thenai.telemetry.functionId), and then thex-runtype-agent-idheader when no span names an agent. When a nested span names a different agent from its nearest named ancestor, Runtype creates a child run for that agent and records asubagenttool call on the parent run. When two agents run side by side in one trace, neither inside the other, each gets its own run: one is listed as a child of the other’s run, with nosubagenttool call. One trace can hold at most 20 runs (run_limit_reached), and one product can gain at most 50 trace-created agents (agent_limit_reached). A trace that names no agent waits up to 10 minutes for a naming span, then falls back toservice.name. - OTLP logs: Requires a telemetry API key (a product ingest key returns
403). Checksruntype.agent.idon the log resource, then thex-runtype-agent-idheader. Without either, Runtype discards thoseLogRecordentries and returns OTLPpartial_success. A trace ID on aLogRecordlinks it to the trace in Logs, but doesn’t create a run.
OTLP LogRecord entries follow the receiving agent’s logging policy and personally identifiable information (PII) redaction setting. With Verbose logging set to Off, Runtype drops each record’s body and attributes and keeps its timestamp, severity, trace ID, span ID, and conversation ID. The log detail view shows Verbose logging off.
Environment and release
The following table lists the resource attributes that identify the deployment environment and software release of a trace. Runtype reads runtype.change.id and service.version regardless of content settings:
The following environment variable marks production traces with the change ID from an exported change brief:
Replace YOUR_CHANGE_ID with the changeId returned when you export a change brief. For more information, see Check the prediction after you ship.
Conversation and end-user identity
The following table lists the attributes that group runs into conversations and identify end users:
Runtype resolves the fallback conversation ID and the end-user ID independently. For each field, the invoke_agent or parentless root span wins, followed by the earliest span by start time.
If secret scrubbing or PII redaction changes a conversation ID or an end-user ID, or if the value is longer than 256 UTF-8 bytes, Runtype records a stable per-account one-way digest in its place, starting with otel-conversation-v1- or otel-end-user-v1-. Different IDs keep different digests. The digest is a pseudonym, not anonymization.
Instrumentation provenance
The following table lists the attributes that record which library or adapter emitted a trace:
The following environment variable sets adapter provenance on the resource:
Replace agent_YOUR_AGENT_ID with the ID of the receiving Runtype agent.
@runtypelabs/flue-otel sets both attributes on every invoke_agent span that it opens. For Flue setup details, see Instrument a Flue agent. @runtypelabs/runtime, @runtypelabs/openclaw-adapter, @runtypelabs/pi-otel, @runtypelabs/cloudflare-agents, and runtype-pydantic-ai also set both attributes automatically. Your resource attribute takes precedence if you set both.
Agent version and release alias
The following table lists the attributes that file a run under a published Runtype agent version and release alias:
The following environment variable tags runs with a published agent version and release alias:
Replace the following:
agent_YOUR_AGENT_ID: the ID of the receiving Runtype agent.agentver_YOUR_VERSION_ID: the published version ID belonging to that agent.
Agents exported with @runtypelabs/runtime emit these attributes automatically from ExportedAgent.release. For details, see Self-hosting (BYOC).
Operations, models, usage, and tools
Runtype creates a run for a trace when any span carries a generative AI (GenAI) operation (gen_ai.operation.name), a model ID (gen_ai.request.model or gen_ai.response.model), or one of the runtype.* attributes or span events marked as qualifying in Runtype execution extensions. Otherwise the trace stays in Logs and creates no run.
The following table lists the GenAI span attributes that Runtype reads for run structure, models, token counts, and tool calls:
Runtype calculates a cost estimate from token counts and the Runtype model catalog. Your model provider bills you for the calls, so treat the figure as an estimate.
Span status and errors
Runtype determines run and tool outcomes from OpenTelemetry span status and exception span events:
ERROR(code2): Marks aninvoke_agentrun orexecute_toolcall as failed. Runtype reads the error message fromstatus.message.UNSET(code0) with anexceptionevent: Marks aninvoke_agentrun as failed and reads the error message fromexception.typeandexception.messageon the event. Without anexceptionevent,UNSETcounts as successful.OK(code1): Counts as successful, even when the span carries anexceptionevent.- Traces without an
invoke_agentor parentless root span: After every span has ended, Runtype marks the run as failed when its last spans to end report errors.
Runtype execution extensions
Optional runtype.* span attributes and span events record loop structure, parent-child run links, tool categories, self-reported cost, provider finish reasons, and approval spans. The following table lists the runtype.* span attributes that Runtype reads:
Runtype also recognizes these span names and span events:
- Approval spans: A span named
tool_approval,tool_approval <tool-name>, orruntype.agent.approvalappears as an approval rather than a tool call. When paired withruntype.approval.decision, it qualifies the trace to create a run. - Approval span events:
runtype.approval.requestedandruntype.approval.resolvedspan events appear in Logs, and either event qualifies the trace to create a run. - Skill-load span events:
runtype.skill.loadedspan events appear in Logs, and the event qualifies the trace to create a run.
Framework-specific span attributes
When a trace comes from a supported framework instrumentation instead of raw GenAI attributes, Runtype maps its attributes onto the GenAI fields in the preceding tables. The following table lists the framework attributes that Runtype maps:
Content attributes
Runtype records conversation content only when your instrumentation puts it on the span. The following table lists the GenAI content attributes that Runtype reads:
Alternative content attribute names
When a span carries both a standard GenAI content attribute and a framework-specific alternative, Runtype uses the standard attribute. The following table lists the alternative names that Runtype reads:
When @runtypelabs/runtime sets runtype.context.blocks and runtype.context.manifest on a chat span, Runtype records the blocks as that model call’s input content and doesn’t show either attribute in the span’s attribute list in Logs.
Content limits and discarded attributes
Runtype scrubs credential-shaped strings from content attributes, replacing each match with [REDACTED:LABEL] (where LABEL names the matched credential type, such as RUNTYPE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, GITHUB_TOKEN, AWS_ACCESS_KEY_ID, GOOGLE_API_KEY, SLACK_TOKEN, STRIPE_KEY, JWT, BEARER_TOKEN, or PRIVATE_KEY). Runtype replaces nested objects or arrays deeper than 64 levels with [DROPPED:DEPTH].
Runtype enforces three content size limits:
- Per attribute: Drops a content attribute over 256 KiB (
262,144characters). - Per span: Drops content attributes past 384 KiB (
393,216characters) on one span. - Per trace (run content) and per export (Logs): Drops content attributes past 2 MiB (
2,097,152characters) across the whole trace for run content, and per export request for Logs. Splitting a trace across exporter batches doesn’t reset the run-content limit.
Runtype drops each affected value whole rather than truncating it. For per-trace span count and span data limits (trace_too_large), see Limits and pricing.
Content appears on the run, not in a span’s attribute list in Logs. Runtype discards the following framework content attributes and doesn’t keep them:
- OpenInference:
retrieval.documents.*,llm.prompt_template.*,embedding.embeddings.*,llm.prompts,llm.choices, andllm.function_call. - Mastra:
mastra.<span-type>.input,mastra.<span-type>.output, andmastra.metadata.body. - Cloudflare Agents SDK:
cloudflare.agents.metadata.*andcloudflare.agents.runtime_context.*. - Vercel AI SDK:
ai.response.toolCalls.
For logging policy settings, PII redaction, and how to turn content capture on or off per framework, see Control what content is sent.
Next steps
- Send a first trace: instrument an agent with Runtype Connect and run the first-trace check.
- Instrument a supported framework: configure OTLP/HTTP exporters and framework adapters by hand.
- Instrument a custom agent loop: emit OpenTelemetry spans from your own loop or route several services through one collector.
- Limits and pricing: review OTLP request limits, monthly span limits, and retention windows.
- Troubleshooting: resolve ingest rejection codes and first-trace check failures.