---
title: Send OpenInference traces to Agent Analytics
description: "Export Agno, smolagents, DSPy, Haystack, Google GenAI, and AutoGen OpenInference spans to Agent Analytics."
product: general
lang: en
last_updated: 2026-10-28
token_estimate: 1532
---
# Send OpenInference traces to Agent Analytics

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

Agno, smolagents, DSPy, Haystack, the Google GenAI SDK, and AutoGen AgentChat emit OpenInference spans. Point that exporter at Amplitude. You don't need the Amplitude AI SDK in the agent process.

This page covers `agno` 3.1.11, `smolagents` 1.26.0, `dspy` 3.4.1, `haystack-ai` 3.4.1, `google-genai` 2.33.0, and `autogen-agentchat` 0.7.5. Amplitude stores the spans you export. Scrub personal data before it leaves your infrastructure. Refer to [Agent Analytics privacy modes](https://amplitude.com/docs/amplitude-ai/agent-analytics/privacy-modes).

## Set up with your AI coding agent (recommended)

Paste this prompt into your AI coding agent, such as Cursor, Claude Code, Windsurf, GitHub Copilot, or Codex.

```text
Connect this OpenInference agent to Amplitude Agent Analytics with native OpenTelemetry.

Fetch https://raw.githubusercontent.com/amplitude/Amplitude-AI-Node/main/docs/integrations/openinference.md
and follow "Part 2: Coding agent procedure".
If @amplitude/ai is installed, the same file is under node_modules/@amplitude/ai/docs/integrations/.
Also follow https://raw.githubusercontent.com/amplitude/Amplitude-AI-Node/main/docs/integrations/privacy.md
and scrub content before export.
Follow links in the guide. If your source isn't listed, start at https://raw.githubusercontent.com/amplitude/Amplitude-AI-Node/main/docs/integrations/README.md
```

Review the changes, then verify with the steps in [Get started](#get-started).

## What this means for you

- **You run**: The agent process, with the OpenInference instrumentor for that framework pointed at Amplitude.
- **You need**: The pinned package above, the matching `openinference-instrumentation-*` package, your Amplitude project API key, and a span processor that sets `user.id`, `session.id`, and `gen_ai.agent.id`.
- **Protocol**: OTLP over HTTP. Amplitude accepts protobuf and JSON. Amplitude doesn't accept gRPC. Don't send OTLP logs.
- **Privacy**: Amplitude doesn't scrub content after receipt. Mask or drop content attributes before export.

## Export

Set these variables in the agent process. Encode the space in the header value as `%20` when the value is in an environment variable. Leave `Authorization=` as written.

```bash
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://api.amplitude.com/otlp/v1/traces
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20<project API key>"
OTEL_SERVICE_NAME=order-support
```

EU data residency uses `https://api.eu.amplitude.com/otlp/v1/traces`.

## Identity

| Attribute | Value |
| --- | --- |
| `session.id` | The conversation, thread, or ticket ID. Use the same value on every turn. |
| `user.id` | The user ID product analytics already uses. Amplitude stores a missing user as `unknown`. |
| `gen_ai.agent.id` | A stable name for this agent. Amplitude doesn't read `gen_ai.agent.name`. |

## What carries over

| Framework | `[Agent] Tool Call` | What this capture showed |
| --- | --- | --- |
| Agno 3.1.11 | Yes | Tool name and arguments, and the reply on the model span |
| smolagents 1.26.0 | Yes | The reply is the `final_answer` tool result |
| DSPy 3.4.1 | Yes, after you set `tool.name` at export | Every model call records the question. The model name arrives. Token counts don't |
| Haystack 3.4.1 | No | The tool call stays inside the model span |
| Google GenAI SDK 2.33.0 | No | Automatic function calling stays inside the SDK |
| AutoGen AgentChat 0.7.5 | Yes | Tool name and arguments, and the reply on the model span |

Haystack and the Google GenAI SDK still produce the session, the user, the model, both token counts, and the reply text.

`TraceConfig` with the hide-input and hide-output flags omits message attributes, so the prompt and reply text don't arrive. `input.value` and `output.value` are the placeholder `__REDACTED__`. Amplitude drops that placeholder, so tool arguments and tool results are empty. Agno and AutoGen still send the arguments on `tool.parameters`. Google GenAI still sends them on `message.tool_calls.0.tool_call.function.arguments`. smolagents still sends the user question on `smolagents.task`. Amplitude stores those attributes. Session, user, and agent stay. Agno, smolagents, Haystack, Google GenAI, and AutoGen keep the model name and both token counts. DSPy keeps the model name and drops the token counts. Agno, smolagents, DSPy, and AutoGen keep `tool.name`. Haystack and the Google GenAI SDK still have no tool span.

## Session close

`[Agent] Session End` is optional and recommended. A native OpenInference export doesn't send it. Amplitude closes the session after 30 minutes without a qualifying agent event by default, and 24 hours from the session start when no per-session override is set. The first close is the one that counts. Enrichment, including the Session Record and content-based signals, runs once after that close. The OpenTelemetry translator doesn't read an idle-timeout attribute from a span. Refer to [How sessions close](https://amplitude.com/docs/amplitude-ai/agent-analytics/sessions#how-sessions-close).

## Get started

Follow the [OpenInference integration guide](https://github.com/amplitude/Amplitude-AI-Node/blob/main/docs/integrations/openinference.md). Send two turns with the same session id, then confirm in Live Events:

1. Session ID is the processor session id, not a trace ID.
2. User ID is the product-analytics user, not `unknown`.
3. Agent ID is `gen_ai.agent.id`.
4. Agno, smolagents, DSPy, and AutoGen show a tool call. Haystack and the Google GenAI SDK show the reply and don't show a tool call.
5. The AI Response has the model name and both token counts.

Guide last verified on October 28, 2026, against `agno` 3.1.11, `smolagents` 1.26.0, `dspy` 3.4.1, `haystack-ai` 3.4.1, `google-genai` 2.33.0, and `autogen-agentchat` 0.7.5. Those names are trademarks of their owners. Amplitude isn't affiliated with or endorsed by those owners.

