> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runtype.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runtype.com/_mcp/server.

# Send a first trace

> Instrument your agent for Runtype, run it once in development, and confirm that the first-trace check passes.

Instrument your agent to export OpenTelemetry traces to Runtype, run it once in
development, and confirm that Runtype accepts and reads the trace. When the
first-trace check reports `healthy`, your repository is ready for analysis and
simulation.

## Before you begin

You need the following:

* A connected repository with `RUNTYPE_INGEST_KEY`, `RUNTYPE_OTLP_URL`, and
  `RUNTYPE_ENVIRONMENT` in `.env` or your chosen env file. If you haven't
  connected the repository, follow
  [Connect a repository](/connect/connect-a-repository).
* A local command, script, or test that runs your agent end to end.

## Get the setup for your framework

The `runtype-connect` CLI and the Runtype Connect Model Context Protocol (MCP)
server provide setups for `AI SDK`, `LangGraph`, `OpenAI Agents SDK`,
`Pydantic AI`, `Mastra`, `OpenAI Agents SDK (TypeScript)`, `eve`, `Flue`, and
`OpenTelemetry GenAI` (for an agent loop you wrote yourself). When your project
already sends traces somewhere, such as Logfire with Pydantic AI or Flue's own
OpenTelemetry instrumentation, the setup adds Runtype beside that telemetry.
Get the setup in one of the following ways:

* **From `init`**: If `init` opened your coding agent, your coding agent already
  has the setup prompt for the detected framework. Otherwise, paste the prompt
  that `init` printed into your coding agent. That prompt includes the install
  command, env loading, and instrumentation code.
* **From your coding agent**: Ask your coding agent to call the `get_setup` tool
  with your framework. Without a framework, `get_setup` returns only the list of
  supported framework names.
* **From the CLI**: Run `get-setup` with `--framework` to print the same setup:

  **`Get a framework setup`**

  ```bash title="Get a framework setup"
  npx @runtypelabs/connect get-setup --framework "FRAMEWORK_NAME"
  ```

  Replace `FRAMEWORK_NAME` with `AI SDK`, `LangGraph`, `OpenAI Agents SDK`,
  `Pydantic AI`, `Mastra`, `OpenAI Agents SDK (TypeScript)`, `eve`, `Flue`, or
  `OpenTelemetry GenAI`.

To set up Flue by hand, see [Instrument a Flue agent](/connect/instrument-a-flue-agent). To set up
Mastra by hand, see
[Send traces from a supported framework](/connect/instrument-a-supported-framework#send-traces-from-a-supported-framework).
For other supported frameworks (Cloudflare Agents, OpenClaw, Hermes, or Pi) or a manual exporter with a telemetry API key, see
[Instrument a supported framework](/connect/instrument-a-supported-framework).

## Instrument your agent

Each Connect setup configures the following on every run:

* **Agent name**: Set in `gen_ai.agent.name`. Runtype creates an agent in the
  product for each distinct name it receives (up to 50 agents per product), so
  give each agent a stable name.
* **Environment**: Set in the `deployment.environment.name` resource attribute
  and read from `RUNTYPE_ENVIRONMENT` (default `development`). Runtype counts
  `production` and `prod` (case-insensitive) as production, and any other value
  as development.
* **Conversation ID and end-user ID**: Set in `gen_ai.conversation.id` and
  `user.id`.
* **Conversation content**: User and assistant messages, the system prompt, and
  tool definitions, inputs, and outputs. Analysis and simulation require this
  content. If your app already redacts content, your coding agent asks before
  changing it. Decide what content to send to Runtype. For more information, see
  [Control what content is sent](/connect/control-what-content-is-sent).

Each setup loads `RUNTYPE_INGEST_KEY`, `RUNTYPE_OTLP_URL`, and
`RUNTYPE_ENVIRONMENT` from `.env`. It exports spans over the OpenTelemetry
Protocol (OTLP) to `RUNTYPE_OTLP_URL` with the ingest key as the bearer token.
If `init` wrote those variables to another file (such as `.env.local`), load
that file instead.

Import the instrumentation file first in your entry point, before the agent
runs. If your project already configures OpenTelemetry, add the Runtype exporter
and `deployment.environment.name` to that provider instead of starting a second
one. Leave your existing exporters unchanged.

Give the Runtype exporter its own URL and headers instead of
`OTEL_EXPORTER_OTLP_HEADERS`. Every OTLP exporter reads that variable, so using
it can send credentials to the wrong collector. If your app redacts content
before export, Runtype receives the redacted content.

A batch span processor holds spans for about 5 seconds. Flush before a
short-lived script exits, or its spans don't leave the process. In a serverless
handler, flush at the end of each request because the runtime freezes the
handler instead of exiting it.

Your coding agent can apply this setup for you. Choose your framework in the
following tabs to see what it adds. For `Mastra`, `OpenAI Agents SDK (TypeScript)`,
`eve`, and `Flue`, run `init` or call `get_setup` with that framework name:

#### AI SDK

Install the packages with your project's package manager. Pick the
`@ai-sdk/otel` release whose patch number matches your installed `ai`
package, such as `@ai-sdk/otel@1.0.181` with `ai@7.0.181`. A mismatched pair
fails to type-check:

**`Install`**

```bash title="Install"
npm i @ai-sdk/otel @opentelemetry/sdk-node @opentelemetry/sdk-trace @opentelemetry/exporter-trace-otlp-proto @opentelemetry/resources dotenv
```

If you use `pnpm`, the install can exit with `ERR_PNPM_IGNORED_BUILDS` for
`protobufjs`. The packages install and work without that build script.

Create `instrumentation.ts` to register the exporter and telemetry
integration:

**`instrumentation.ts`**

```ts title="instrumentation.ts"
import 'dotenv/config'
import { OpenTelemetry } from '@ai-sdk/otel'
import { NodeSDK } from '@opentelemetry/sdk-node'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto'
import {
  defaultResource,
  resourceFromAttributes,
} from '@opentelemetry/resources'
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace'
import { registerTelemetry } from 'ai'

const spanProcessor = new BatchSpanProcessor({
  exporter: new OTLPTraceExporter({
    url: process.env.RUNTYPE_OTLP_URL,
    headers: {
      authorization: `Bearer ${process.env.RUNTYPE_INGEST_KEY}`,
    },
  }),
})

export const sdk = new NodeSDK({
  resource: defaultResource().merge(
    resourceFromAttributes({
      'deployment.environment.name':
        process.env.RUNTYPE_ENVIRONMENT ?? 'development',
    })
  ),
  spanProcessors: [spanProcessor],
})
sdk.start()

export function flushTelemetry(): Promise<void> {
  return spanProcessor.forceFlush()
}

registerTelemetry(
  new OpenTelemetry({
    agentSpanName: 'functionId',
    enrichSpan: ({ runtimeContext }) => ({
      ...(typeof runtimeContext?.conversationId === 'string'
        ? { 'gen_ai.conversation.id': runtimeContext.conversationId }
        : {}),
      ...(typeof runtimeContext?.userId === 'string'
        ? { 'user.id': runtimeContext.userId }
        : {}),
    }),
  })
)

process.once('beforeExit', () => void sdk.shutdown().catch(console.error))
```

Import `instrumentation.ts` as the first import of your entry point:

**`Entry point`**

```ts title="Entry point"
import './instrumentation'
```

Name each agent with `functionId` and pass the conversation ID and end-user
ID at each `generateText` and `streamText` call. Each `functionId` becomes
one agent in Runtype:

**`Call site`**

```ts title="Call site"
const result = await generateText({
  model,
  prompt,
  runtimeContext: { conversationId, userId },
  telemetry: {
    functionId: 'support-agent',
    includeRuntimeContext: { conversationId: true, userId: true },
  },
})
```

In a serverless handler, await `flushTelemetry()` at the end of each
request. It sends finished spans and keeps the exporter open for the next
request.

If you use `ToolLoopAgent`, pass `runtimeContext` and `telemetry` to
`new ToolLoopAgent({ ... })`, because `generate()` and `stream()` take
neither option. Build the agent per conversation when those IDs change per
conversation.

On AI SDK 5 or 6, leave `@ai-sdk/otel` out of the install command and remove
the `@ai-sdk/otel` and `registerTelemetry` code from `instrumentation.ts`.
Turn telemetry on at each call site instead:

**`Call site on AI SDK 5 or 6`**

```ts title="Call site on AI SDK 5 or 6"
const result = await generateText({
  model,
  prompt,
  experimental_telemetry: {
    isEnabled: true,
    functionId: 'support-agent',
    metadata: { sessionId: conversationId, userId },
  },
})
```

#### LangGraph

Install the OpenInference and OpenTelemetry packages with your project's
Python package tool (`uv add` or `poetry add` work in place of
`pip install`):

**`Install`**

```bash title="Install"
pip install openinference-instrumentation-langchain opentelemetry-sdk opentelemetry-exporter-otlp-proto-http python-dotenv
```

Create `instrumentation.py` to export spans and put the agent name,
conversation ID, and end-user ID on every span:

**`instrumentation.py`**

```py title="instrumentation.py"
import os
from contextlib import contextmanager

from dotenv import load_dotenv
from opentelemetry import baggage, context, trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import (
    OTLPSpanExporter,
)
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import SpanProcessor, TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from openinference.instrumentation.langchain import LangChainInstrumentor

load_dotenv()

RUN_ATTRIBUTES = (
    "gen_ai.agent.name",
    "gen_ai.conversation.id",
    "user.id",
)


class RunAttributes(SpanProcessor):
    def on_start(self, span, parent_context=None):
        for key, value in baggage.get_all(parent_context).items():
            if key in RUN_ATTRIBUTES and value and key not in span.attributes:
                span.set_attribute(key, value)


provider = TracerProvider(
    resource=Resource.create(
        {
            "deployment.environment.name": os.environ.get(
                "RUNTYPE_ENVIRONMENT", "development"
            )
        }
    )
)
provider.add_span_processor(RunAttributes())
provider.add_span_processor(
    BatchSpanProcessor(
        OTLPSpanExporter(
            endpoint=os.environ["RUNTYPE_OTLP_URL"],
            headers={
                "authorization": f"Bearer {os.environ['RUNTYPE_INGEST_KEY']}"
            },
        )
    )
)
trace.set_tracer_provider(provider)
LangChainInstrumentor().instrument(tracer_provider=provider)


@contextmanager
def agent_run(agent_name=None, conversation_id=None, user_id=None):
    """Put the agent name, conversation ID, and end-user ID on every span."""
    ctx = context.get_current()
    for key, value in zip(
        RUN_ATTRIBUTES, (agent_name, conversation_id, user_id)
    ):
        if value:
            ctx = baggage.set_baggage(key, str(value), context=ctx)
    token = context.attach(ctx)
    try:
        yield
    finally:
        context.detach(token)
```

Import `instrumentation` at the top of your entry point before the agent
runs:

**`Entry point`**

```py title="Entry point"
import instrumentation
```

LangGraph spans carry no agent name, so pass one stable name per graph to
`agent_run` and wrap each invocation in it:

**`Run the graph`**

```py title="Run the graph"
from instrumentation import agent_run, provider

with agent_run(
    "support-agent", conversation_id=thread_id, user_id=user_id
):
    result = graph.invoke(
        {"messages": [{"role": "user", "content": text}]},
        {"configurable": {"thread_id": thread_id}},
    )

provider.force_flush()
```

#### OpenAI Agents SDK

Install the OpenInference and OpenTelemetry packages with your project's
Python package tool:

**`Install`**

```bash title="Install"
pip install openinference-instrumentation-openai-agents opentelemetry-sdk opentelemetry-exporter-otlp-proto-http python-dotenv
```

Create `instrumentation.py` to export spans and put the agent name,
conversation ID, and end-user ID on every span:

**`instrumentation.py`**

```py title="instrumentation.py"
import os
from contextlib import contextmanager

from dotenv import load_dotenv
from opentelemetry import baggage, context, trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import (
    OTLPSpanExporter,
)
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import SpanProcessor, TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from openinference.instrumentation.openai_agents import (
    OpenAIAgentsInstrumentor,
)

load_dotenv()

RUN_ATTRIBUTES = (
    "gen_ai.agent.name",
    "gen_ai.conversation.id",
    "user.id",
)


class RunAttributes(SpanProcessor):
    def on_start(self, span, parent_context=None):
        for key, value in baggage.get_all(parent_context).items():
            if key in RUN_ATTRIBUTES and value and key not in span.attributes:
                span.set_attribute(key, value)


class AgentSpanNames(SpanProcessor):
    def on_start(self, span, parent_context=None):
        parent = getattr(
            trace.get_current_span(parent_context), "attributes", {}
        )
        if (
            "openinference.span.kind" not in span.attributes
            or "gen_ai.agent.name" in span.attributes
        ):
            return
        if (
            span.attributes["openinference.span.kind"] == "AGENT"
            and "openinference.span.kind" in parent
        ):
            span.set_attribute("gen_ai.agent.name", span.name)
        elif "gen_ai.agent.name" in parent:
            span.set_attribute(
                "gen_ai.agent.name", parent["gen_ai.agent.name"]
            )


provider = TracerProvider(
    resource=Resource.create(
        {
            "deployment.environment.name": os.environ.get(
                "RUNTYPE_ENVIRONMENT", "development"
            )
        }
    )
)
provider.add_span_processor(AgentSpanNames())
provider.add_span_processor(RunAttributes())
provider.add_span_processor(
    BatchSpanProcessor(
        OTLPSpanExporter(
            endpoint=os.environ["RUNTYPE_OTLP_URL"],
            headers={
                "authorization": f"Bearer {os.environ['RUNTYPE_INGEST_KEY']}"
            },
        )
    )
)
trace.set_tracer_provider(provider)
OpenAIAgentsInstrumentor().instrument(tracer_provider=provider)


@contextmanager
def agent_run(agent_name=None, conversation_id=None, user_id=None):
    """Put the agent name, conversation ID, and end-user ID on every span."""
    ctx = context.get_current()
    for key, value in zip(
        RUN_ATTRIBUTES, (agent_name, conversation_id, user_id)
    ):
        if value:
            ctx = baggage.set_baggage(key, str(value), context=ctx)
    token = context.attach(ctx)
    try:
        yield
    finally:
        context.detach(token)
```

Import `instrumentation` at the top of your entry point before the agent
runs:

**`Entry point`**

```py title="Entry point"
import instrumentation
```

Each `Agent` name becomes one agent in Runtype, and an `Agent` it hands off
to becomes another, so give every `Agent` a stable name. Pass the starting
`Agent` name as `agent_name` in `agent_run`. Without it, Runtype files
handoff agents under the first agent:

**`Run the agent`**

```py title="Run the agent"
from agents import Agent, Runner
from instrumentation import agent_run, provider

agent = Agent(
    name="support-agent",
    instructions="Answer questions about orders.",
)

with agent_run(
    agent_name=agent.name,
    conversation_id=conversation_id,
    user_id=user_id,
):
    result = Runner.run_sync(agent, text)

provider.force_flush()
```

#### Pydantic AI

Install the OpenTelemetry packages with your project's Python package tool:

**`Install`**

```bash title="Install"
pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http python-dotenv
```

Create `instrumentation.py` to export spans and record the agent name,
conversation ID, end-user ID, and conversation content:

**`instrumentation.py`**

```py title="instrumentation.py"
import os
from contextlib import contextmanager

from dotenv import load_dotenv
from opentelemetry import baggage, context, trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import (
    OTLPSpanExporter,
)
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import SpanProcessor, TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from pydantic_ai import Agent
from pydantic_ai.models.instrumented import InstrumentationSettings

load_dotenv()

RUN_ATTRIBUTES = (
    "gen_ai.agent.name",
    "gen_ai.conversation.id",
    "user.id",
)


class RunAttributes(SpanProcessor):
    def on_start(self, span, parent_context=None):
        for key, value in baggage.get_all(parent_context).items():
            if key in RUN_ATTRIBUTES and value and key not in span.attributes:
                span.set_attribute(key, value)


provider = TracerProvider(
    resource=Resource.create(
        {
            "deployment.environment.name": os.environ.get(
                "RUNTYPE_ENVIRONMENT", "development"
            )
        }
    )
)
provider.add_span_processor(RunAttributes())
provider.add_span_processor(
    BatchSpanProcessor(
        OTLPSpanExporter(
            endpoint=os.environ["RUNTYPE_OTLP_URL"],
            headers={
                "authorization": f"Bearer {os.environ['RUNTYPE_INGEST_KEY']}"
            },
        )
    )
)
trace.set_tracer_provider(provider)
Agent.instrument_all(
    InstrumentationSettings(
        tracer_provider=provider,
        include_content=True,
        version=5,
        use_aggregated_usage_attribute_names=True,
    )
)


@contextmanager
def agent_run(agent_name=None, conversation_id=None, user_id=None):
    """Put the agent name, conversation ID, and end-user ID on every span."""
    ctx = context.get_current()
    for key, value in zip(
        RUN_ATTRIBUTES, (agent_name, conversation_id, user_id)
    ):
        if value:
            ctx = baggage.set_baggage(key, str(value), context=ctx)
    token = context.attach(ctx)
    try:
        yield
    finally:
        context.detach(token)
```

Import `instrumentation` at the top of your entry point before the agent
runs:

**`Entry point`**

```py title="Entry point"
import instrumentation
```

Give every `Agent` a stable name, pass `conversation_id` to the run, and
wrap the run in `agent_run`:

**`Run the agent`**

```py title="Run the agent"
from pydantic_ai import Agent
from instrumentation import agent_run, provider

agent = Agent(
    "openai:gpt-5",
    name="support-agent",
    instructions="Answer questions about orders.",
)

with agent_run(user_id=user_id):
    result = agent.run_sync(text, conversation_id=conversation_id)

provider.force_flush()
```

#### OpenTelemetry GenAI

Install the OpenTelemetry packages for your language. For Node.js, install
the TypeScript SDK packages:

**`Install (Node.js)`**

```bash title="Install (Node.js)"
npm i @opentelemetry/api @opentelemetry/sdk-node @opentelemetry/sdk-trace @opentelemetry/exporter-trace-otlp-proto @opentelemetry/resources dotenv
```

For Python, install the Python SDK packages:

**`Install (Python)`**

```bash title="Install (Python)"
pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http python-dotenv
```

Configure the tracer provider, resource, and OTLP exporter as shown in the
**AI SDK** tab (without `@ai-sdk/otel` and `registerTelemetry`) or in the
Python tabs (without a framework instrumentor). Then emit the three spans
listed in the following table from your agent loop:

| Span                  | `gen_ai.operation.name` | Attributes                                                                                                                                                                                                                                        |
| --------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| One per agent run     | `invoke_agent`          | `gen_ai.agent.name`, `gen_ai.conversation.id`, and `user.id`                                                                                                                                                                                      |
| One per model request | `chat`                  | `gen_ai.system_instructions` (or a `system` message in `gen_ai.input.messages`), `gen_ai.input.messages`, `gen_ai.output.messages` (also when the reply is only tool calls), and `gen_ai.tool.definitions` with the tools offered to that request |
| One per tool call     | `execute_tool`          | `gen_ai.tool.name`, `gen_ai.tool.call.id`, `gen_ai.tool.call.arguments`, and `gen_ai.tool.call.result`                                                                                                                                            |

Nest the `chat` and `execute_tool` spans under the run's `invoke_agent`
span. A loop that calls the model several times in one run emits several
`chat` spans.

Call the `get_setup` tool with `framework` set to `"OpenTelemetry GenAI"`
for a complete example loop. For hand-written span details and non-OTLP
options, see
[Instrument a custom agent loop](/connect/instrument-a-custom-agent-loop).

## Run the agent and check the first trace

Nothing reaches Runtype until your agent runs. To send a first trace and verify
it, follow these steps:

1. Run your agent once locally, end to end, with
   `RUNTYPE_ENVIRONMENT=development`. Use your project's normal run command,
   script, or test. If the run fails, fix that error before checking the trace.

2. Run the `check` command from the repository root (or ask your coding agent
   to call the `check_first_trace` tool):

   **`Check the first run`**

   ```bash title="Check the first run"
   npx @runtypelabs/connect check
   ```

   The `check` command finds your product from the ingest key in `.env`. Pass
   `--product` to check another product.

3. Wait for the check to return. By default, it waits up to 30 seconds for a
   run to arrive. Pass `--wait` with a number of seconds from `0` to `50` to
   change that.

The check looks at the newest development run of each agent (up to five). In
the dashboard, your product shows **Connected agents** and a run appears.
**Connect an agent** reports "A run arrived".

### Read the check status

The check returns one of the five statuses in the following table:

| Status            | Meaning                                                                                                                                                   | What to do                                                                                                                                                                                                        |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `healthy`         | A run arrived and every required check passed.                                                                                                            | Proceed to describing your agents.                                                                                                                                                                                |
| `degraded`        | A run arrived and nothing failed, but a check warned that the traces are below the fidelity Runtype needs, for example content the app declares withheld. | Nothing needs fixing. The check says what is missing and what it costs, and a coding agent relays that from `fixPrompt`. Then proceed. See [Control what content is sent](/connect/control-what-content-is-sent). |
| `needs_attention` | A run arrived with a failed check, or Runtype refused an export.                                                                                          | Apply each item in `fixPrompt`, then run the agent and check again.                                                                                                                                               |
| `processing`      | A run arrived and Runtype is still processing it.                                                                                                         | Wait a moment and run the check again.                                                                                                                                                                            |
| `no_traces`       | Nothing arrived.                                                                                                                                          | Confirm that the agent ran end to end, verify `RUNTYPE_OTLP_URL`, and confirm that spans flush on exit.                                                                                                           |

The `check` command exits with code `0` for `healthy`, `1` for
`needs_attention`, `5` for `degraded`, and `6` for `processing` or `no_traces`. Pass `--json` to
print the raw check result.

### Read the eight per-agent checks

The check evaluates eight checks for each examined agent, as shown in the
following table:

| Check              | Required | Passes when the run carries                                                                      |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------ |
| `attribution`      | Yes      | Traces that reach this product and name an agent                                                 |
| `content`          | Yes      | Readable user and assistant messages that aren't replaced by redaction markers                   |
| `system_prompt`    | Yes      | A system prompt in `gen_ai.system_instructions` or a `system` message in `gen_ai.input.messages` |
| `tool_definitions` | Yes      | Tool definitions offered to the model                                                            |
| `tool_io`          | Yes      | Both inputs and outputs on `execute_tool` spans                                                  |
| `conversation_id`  | Yes      | A conversation ID                                                                                |
| `environment`      | Yes      | A deployment environment                                                                         |
| `end_user_id`      | No       | An end-user ID                                                                                   |

A check reports `unknown` when the run can't show the answer. For example,
`tool_definitions` and `tool_io` report `unknown` when a run calls no tools.
Neither an `unknown` check nor a failed `end_user_id` check turns the status
into `needs_attention`.
A required check reports `warn` when the run works but is below the fidelity
Runtype needs: `content` warns with `withheld_by_app` when the app declares its
content withheld. A `warn` check makes the status `degraded`, not
`needs_attention`. See [Control what content is sent](/connect/control-what-content-is-sent).

## Fix issues that the check reports

When `status` is `needs_attention`, `fixPrompt` returns the exact changes
needed, ready to paste into your coding agent. The check classifies each
failure so you change the right side:

* **Exporter content capture and redaction**: When `content`, `system_prompt`,
  `tool_definitions`, or `tool_io` fails because the exporter omitted or
  redacted content, `fixPrompt` tells you what to enable in your
  instrumentation. For OpenTelemetry GenAI instrumentations, set
  `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true` and turn off
  redaction for development runs.
* **Runtype logging policy and redaction**: When the agent's logging policy is
  off or personally identifiable information (PII) redaction is on in Runtype,
  `fixPrompt` states that the exporter needs no change. Update the agent's
  settings in Runtype instead.
* **Missing attributes**: When `conversation_id`, `environment`,
  `system_prompt`, `tool_definitions`, or `tool_io` fails, `fixPrompt` names
  the exact span or resource attribute to add.
* **No agent name**: If no span carries `gen_ai.agent.name`, `attribution`
  fails. Set it on the invocation span, or set `service.name` on the resource.
* **Refused exports**: When Runtype refuses an export, the check lists recent
  refusals with a fix for each. For the full list of ingest errors and fixes,
  see [Troubleshooting](/reference/troubleshooting).

To verify a fix without matching older runs, follow these steps:

1. Note the current time in ISO 8601 format (for example,
   `2026-06-15T14:30:00Z`).
2. Run your agent once in development again.
3. Run `check` with `--since` (or call `check_first_trace` with `since`) so
   Runtype ignores runs received before your fix:

   **`Re-check after a fix`**

   ```bash title="Re-check after a fix"
   npx @runtypelabs/connect check --since TIMESTAMP
   ```

   Replace `TIMESTAMP` with the ISO 8601 time that you noted before running the
   agent.

Running your test suite afterwards can send incomplete traces. If you do, run
the check again.

When tracing works locally, deploy with `RUNTYPE_ENVIRONMENT=production` and
the same `RUNTYPE_INGEST_KEY` and `RUNTYPE_OTLP_URL` variables.

## Next steps

* [Describe your agents](/analyze/describe-your-agents): send Runtype a map of
  your agents and their business context.
* [Connect your coding agent](/connect/connect-your-coding-agent): add the
  Runtype Connect MCP server to another coding agent or use the CLI directly.
* [Read traces and runs](/analyze/read-traces-and-runs): inspect ingested runs
  and span content from your coding agent or CLI.
* [Trace attributes](/reference/trace-attributes): look up every OpenTelemetry
  attribute that Runtype reads.