> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bronto.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Send eve agent traces to Bronto

> Export traces from eve agents to Bronto over OpenTelemetry with the instrumentation/bronto registry item, and give your agent access to Bronto through the Bronto MCP server.

[eve](https://eve.dev) is Vercel's framework for durable AI agents. It has OpenTelemetry built in: every agent turn, model call, tool call and approval becomes a span that follows the [GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/). Bronto accepts these spans over OTLP directly, so you don't need a Bronto SDK or a Collector.

This page covers two things:

* [Send your agent's traces to Bronto](#send-traces-to-bronto) over OpenTelemetry
* [Let your agent query Bronto](#let-your-agent-query-bronto) through the Bronto MCP server

## Prerequisites

* An eve project (`eve` 1.0 or later)
* A Bronto API key with the **Ingestion** role (see [API Keys](https://docs.bronto.io/Account-Management/API-Keys.md))
* Your Bronto region: `eu` or `us`

## Send traces to Bronto

Install `@vercel/otel`:

```bash theme={"dark"}
pnpm add @vercel/otel
```

Create `agent/instrumentation/bronto.ts`:

```ts agent/instrumentation/bronto.ts theme={"dark"}
import { OTLPHttpProtoTraceExporter } from "@vercel/otel";
import { otelIntegration } from "eve/instrumentation/otel";

export default otelIntegration({
  exportPolicy: {
    span: () => ({ redact: true, inputs: true, outputs: true }),
  },
  traceExporter: new OTLPHttpProtoTraceExporter({
    url: `https://ingestion.${process.env.BRONTO_REGION}.bronto.io/v1/traces`,
    headers: { "x-bronto-api-key": process.env.BRONTO_API_KEY! },
  }),
});
```

> [!NOTE]
>
> An `eve add instrumentation/bronto` command that sets this up for you is on its way to eve's integration registry.

Set two environment variables, in `.env.local` for `eve dev` and in the Vercel project's environment variables for deployments. `eve link` and `vercel env pull` rewrite `.env.local`, so check the variables are still there after running either:

```bash theme={"dark"}
BRONTO_REGION=eu            # or us
BRONTO_API_KEY=<YOUR_API_KEY>
```

eve picks up every file in `agent/instrumentation/`, so the Bronto exporter runs next to any other destinations you have configured.

## Where the traces land

Bronto stores the spans in the `.traces` collection. eve sets `service.name` to the agent's name, so each agent's traces are easy to tell apart without any extra configuration.

To add resource attributes to every span, such as the environment, declare them in `agent/instrumentation/otel.ts`:

```ts agent/instrumentation/otel.ts theme={"dark"}
import { otel } from "eve/instrumentation/otel";

export default otel({
  resource: { "deployment.environment": process.env.VERCEL_ENV ?? "development" },
});
```

eve allows one `otel()` declaration per project. If `agent/instrumentation/otel.ts` already exists, add the attributes to its `resource`.

## What you get

Each agent turn starts a new trace:

```text theme={"dark"}
invoke_agent <agent>
  ├── agent.step
  │     ├── chat <model>              (one per model request)
  │     └── execute_tool <tool>       (one per tool call)
  │           └── agent.approval
  └── agent.approval
```

The same export also carries the Vercel Workflow spans that run the agent's durable session (`workflow.*`, `step.*` and `queue.publish`), with the same `service.name`. To find the agent's own spans, filter on `gen_ai.operation.name`.

The most useful attributes:

| Attribute | What it holds |
| - | - |
| `gen_ai.conversation.id` | The conversation, across the root session and its subagents |
| `agent.run.id` | One agent session |
| `gen_ai.request.model` / `gen_ai.response.model` | Requested and served model |
| `gen_ai.usage.input_tokens` / `gen_ai.usage.output_tokens` | Tokens on `invoke_agent` and `chat` spans |
| `agent.usage.*` | Tokens on `agent.step` and `execute_tool` spans |
| `gen_ai.tool.name`, `gen_ai.tool.call.id` | The tool, and the ID that matches it to its approval span |
| `error.type` | Why a tool call failed |

See eve's [trace topology](https://eve.dev/docs/observability/otel#trace-topology) for the full list, and [LLM Observability](https://docs.bronto.io/ai-features/llm-observability.md) for searching and aggregating `gen_ai.*` fields in Bronto.

## Control what's recorded

The `exportPolicy` in `bronto.ts` removes prompts, replies, tool arguments and tool results before the spans leave your agent. Span names, timings, models, token counts and errors are kept.

To send the content as well, for example to debug the agent's answers, remove `exportPolicy` from `bronto.ts`. eve's own trace policy still applies: by default it records content only in development and in conversations a channel marks as public. Change that with `tracePolicy` in [`otel()`](https://eve.dev/docs/observability/otel#configure-opentelemetry).

> [!WARNING]
>
> Recorded content is searchable by everyone with access to the dataset. If conversations contain personal or regulated data, keep the redaction.

## With a Vercel trace drain

eve's exporter sends spans directly, even when the project also has a [trace drain](https://docs.bronto.io/integrations/vercel-drains.md) to Bronto. With both, every eve span arrives twice. Use one path for the agent's spans. See [OpenTelemetry in Vercel Functions](https://docs.bronto.io/integrations/vercel-otel.md#with-a-trace-drain-on-the-same-project).

## Let your agent query Bronto

The [Bronto MCP server](https://docs.bronto.io/ai-features/hosted-mcp.md) gives an agent tools to search logs and traces, list datasets and run aggregations. An incident or support agent can use it to look up what happened before it answers.

Create a Bronto API key with the **Agent Read Only** role (see [API Keys](https://docs.bronto.io/Account-Management/API-Keys.md)). Don't reuse the ingestion key from `bronto.ts`. Then create `agent/connections/bronto.ts`:

```ts agent/connections/bronto.ts theme={"dark"}
import { defineMcpClientConnection } from "eve/connections";

export default defineMcpClientConnection({
  url: `https://mcp.${process.env.BRONTO_REGION}.bronto.io/mcp`,
  description: "Bronto: search logs and traces, list datasets, and run aggregations.",
  headers: () => ({ "x-bronto-api-key": process.env.BRONTO_MCP_API_KEY! }),
});
```

Set the key in `.env.local` and in the Vercel project's environment variables:

```bash theme={"dark"}
BRONTO_MCP_API_KEY=<YOUR_READ_ONLY_API_KEY>
```

The agent finds the Bronto tools through eve's tool search, as `bronto__search_logs`, `bronto__get_datasets` and so on. Every user of the agent sees the data the key can read.

> [!NOTE]
>
> **Coming soon: sign in per user.** eve can also connect to the Bronto MCP server with each user's own Bronto login, through [Vercel Connect](https://vercel.com/docs/connect) OAuth, so the agent only sees what that user can see. This doesn't work yet with Bronto's MCP server. Use the API key until this page shows the OAuth setup.

## Related

* [OpenTelemetry in Vercel Functions](https://docs.bronto.io/integrations/vercel-otel.md)
* [Tracing into other services](https://docs.bronto.io/integrations/vercel-tracing.md#agents-built-with-eve)
* [Vercel AI SDK](https://docs.bronto.io/integrations/vercel-ai-sdk.md)
* [Vercel AI SDK, AI Gateway and agents](https://docs.bronto.io/integrations/vercel-ai.md): AI Gateway's trace drain continues the agent's traces
* [Hosted MCP Server](https://docs.bronto.io/ai-features/hosted-mcp.md)
* [eve OpenTelemetry guide](https://eve.dev/docs/observability/otel)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.