Setting up the OpenTelemetry data source requires the Editor role or higher. With a lower
role, the OpenTelemetry card can’t be selected.
Supported frameworks
Switch Trust reads traces from the following frameworks:- LangChain, instrumented with OpenInference.
Install
openinference-instrumentation-langchainalongside the OpenTelemetry SDK and exporter. Switch Trust recognizes LangChain traces by their OpenInference instrumentation, so LangChain traces from other instrumentation libraries aren’t read. - Claude Code, using its built-in telemetry. There is nothing to install.
Connect your agent
The Setup tab gives you the values to use, with your own endpoint already filled in.1
Get your connection details
You need two values: your OTLP endpoint and a Switch Trust API token.
- OTLP endpoint. The Setup tab shows the exact URL to use. Copy it from there. It is
a base URL, ending in
/agent/otel, and your OpenTelemetry SDK adds the path for each signal itself. - API token. Use an existing token, or create one now if you don’t have one. Tokens are managed under Settings, then API keys, and the Setup tab has a Create one now shortcut. The token needs the Editor role or higher. A Viewer token is rejected.
2
Set your environment variables
On the Setup tab, choose your agent’s framework under Framework. Then set the
variables it shows in your agent’s environment before you start the agent. Replace the
following placeholders with your own values:
<service>- A name for the service that runs the agent<agent>- The agent’s name (see Name your agent)<apikey>- The API token from the first step
- LangChain
- Claude Code
3
Run your agent
Start your agent as you normally would. Switch Trust starts reading as soon as the first
traces arrive, and you don’t need to create the agent in Switch Trust first.
Name your agent
Switch Trust attributes each trace to an agent, and cost, spend caps, and burn rate are all tracked per agent. Set the agent’s name withgen_ai.agent.name in
OTEL_RESOURCE_ATTRIBUTES, as the variables above do.
If you also scan the agent’s code, use the same name the scan gave the agent, which is the
Name on the agent’s Details card. When the names match, the traces and the scan
results land on one agent. When they don’t, Switch Trust lists two agents and splits the
agent’s cost and history between them. Set the name before the agent first sends traces,
because Switch Trust can’t merge the two agents afterward.
If you don’t set gen_ai.agent.name, Switch Trust names the agent after the nearest agent in
the trace. For Claude Code, or when the trace doesn’t have one, it uses OTEL_SERVICE_NAME
instead.
What you see
Once traces arrive, the agent appears in Agents. Its sessions appear on its Sessions tab and its spending on its cost cards. Each turn also appears on the Live page. Switch Trust prices each model call from Model pricing. If the agent calls a model Switch Trust has no list price for, such as a model served from Hugging Face, its usage counts as $0 until you set a price for it. The OpenTelemetry data source has no Scans tab, and its card doesn’t show a Connected status. To confirm that traces are arriving, open the agent and check its Sessions tab.Next steps
Live traffic
Watch your agents’ turns as they happen
Connect another data source
Add a repository or a cloud platform to widen your inventory

