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

# Import from traces

> Use OpenTelemetry runs your agent already sent to AgentHub, either to fill the Cost Calculator configuration or to analyze the real runs directly as a measured run.

If your agent already sends traces to this project, you don't have to describe it by hand. **From traces** on the Cost Calculator's [Step 1](/agenthub/cost-calculator/configure) opens **Import from traces**, which lists your real runs and offers two paths:

| Button | What it does | Model calls |
| - | - | - |
| **Review config first** | Reads the selected runs and lets you merge their system prompt, tone and tools into the form. You then generate scenarios as usual. | None for the extraction itself. A small platform-funded call may write the prompt or tone when the runs didn't record one. |
| **Import & analyze** | Turns the selected runs themselves into a finished run: each trace becomes a scenario, with its real cost, tokens and outcome. You land straight on Results. | **None.** Nothing is re-run. |

## Which runs are listed

"These are real runs your agent already produced. ... Only OpenTelemetry-collected runs are listed — traces CorePillar generated itself are excluded."

* Only traces that arrived through the OpenTelemetry endpoint for this project are shown. Cost Calculator simulations and traces sent to the older JSON ingest endpoint are not.
* Up to 100 of the most recent runs are listed.
* Each row shows the root span name, an **Error** badge if the trace failed, the service name, how long ago it ran, and "*N* spans · *N* model calls · *N* tool calls · *N* tokens · duration", plus the SDK when it was recorded.
* Header: "*N* OpenTelemetry runs · *N* selected", with **Select all** (or **Select first 25**) and **Clear**. You can select up to **25** runs; the rest are disabled once you hit the cap.

**Empty state:** "CorePillar receives OTLP over HTTP. Point an existing OpenTelemetry exporter at this project and its runs show up here — this list deliberately skips the simulated traces the Cost Calculator produces itself." with **Open the integration guide** (the [Overview](/agenthub/overview#send-your-first-trace) page).

## Analysis model

Below the list, choose a model from this project for **analysis**. "Runs the audit and any targeted fixes on these traces afterward — not the model that produced them. The traces already recorded which model ran them; this only picks what will analyze them."

It is required for **Import & analyze** ("Select a model to enable Import & analyze."). If the project has no models: "Add provider keys and register models in Model Manager before importing traces — analyzing them (audit, targeted fixes) needs a model of its own to run on." with **Go to Model Manager**.

## Path 1: Review config first

The button reads **Reading runs…**, then the dialog switches to a review step: "Read from *N* runs. Nothing is applied until you confirm."

What the review shows:

* **Volumes**: spans, model calls, tool calls, average tokens per run and average duration, and the models seen with their call counts and `max_tokens`. "Context only — the Cost Calculator has no field for these, so nothing here is applied."
* **System prompt**: each distinct system message the runs recorded, to pick from. If none recorded one, a prompt "Written from these runs" from the tools they called and a real exchange they handled, with "Read it before importing." If none did and nothing can be written: "None of these runs recorded a system message. That usually means content capture is off ... Nothing is invented to fill the gap."
* If your form already has a system prompt: "You already have a system prompt. What should happen to it?"
  * **Keep mine and append the imported prompt below it**
  * **Replace mine with the imported prompt**
  * **Keep mine — import the items only**
* **Tone**: "OpenTelemetry has no attribute for tone." It is read from how the system prompt words its instructions, or written from how the runs read. If your form has a tone, the option says it replaces it.
* **Items**: tools, skills, memory and connectors. Tool calls are read straight off the spans and are marked observed. "It defines nothing that means "skill", "memory" or "connector" — those are our reading of a neighbouring signal, start unchecked, and name the attribute they came from." **Select all *N* inferred** ticks them. Items you already have are marked **Already configured** and can't be added twice. Runs with nothing to extract are counted.

The footer summarizes what will change, for example "System prompt (append) · 4 items", and warns when items go over the 50-item limit. **Add to configuration** applies it. **Back to runs** returns to the list.

Applying is additive: tools are appended to what you have, and the prompt follows the option you chose. The toast reads "Imported from traces — system prompt + tone + 4 items", or "Nothing was imported". Every imported item is set to simulated.

## Path 2: Import & analyze

The button reads **Import & analyze (*N*)** and **Analyzing…** while it works.

* Up to **20** traces are adopted per click. If you selected more, the rest are reported as skipped.
* Each trace becomes a scenario named after its root span. Its category comes from what the trace actually did (tool use, retrieval or conversational), not from the generated-scenario categories. Its goal is the real first user message when one was captured.
* Each scenario's result carries the trace's real cost, tokens and OK/ERROR outcome, scored with the same deterministic scorer generated scenarios use.
* A trace that was already imported into this project is left alone and reported as already imported.

You land on Results with the badge **Imported from OpenTelemetry** (plus the service name). The toast summarizes "Traces analyzed — *N* imported, *N* already imported, *N* skipped".

The cost basis is shown in the summary when it isn't the provider's own figure:

| Basis | Caption |
| - | - |
| Reported | The trace carried the provider's cost. No caption. |
| Estimated | "Estimated from tokens at list price — not a billed amount." |
| Partly estimated | "Partly provider-reported, partly estimated from tokens at list price." |
| Unpriced | "Cost unavailable — no reported cost and no catalog price for the model used." |

Imported runs have no **Run scenarios** button and are excluded from Cost Calculator spend on the [AI Usage](/agenthub/ai-usage) dashboard, since that money was your production spend, not a call AgentHub made. You can still run the **Agent Audit** on them, using the analysis model.

### Generate similar scenarios

On an imported run's results, a **Generate similar scenarios** card lets you add synthetic scenarios "Modelled statistically on the *N* trace(s) you just imported — real tool names, real models, real token sizes and call order."

* **Count**: 0 to 20 (default 0). Click **Generate *N* similar scenarios**.
* New rows appear in the results tagged **Synthetic**, with a projected cost. "They never ran, so they never count toward pass rate, accuracy or measured spend."
* Generation is a small Claude Haiku call funded through your organization's Platform Demo Key allowance, not billed to your own key.

## Related

* [Traces](/agenthub/traces): where the imported runs come from
* [Tracing quickstart](/agenthub/developers/tracing-quickstart): send OpenTelemetry traces to AgentHub
* [Step 3: Results](/agenthub/cost-calculator/results)


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