Skip to main content

Choose a setup method

Start with one method for a call path. Combining SDK tracking with framework OpenTelemetry on the same call can create duplicate interactions.
Recommended. Choose this path when you want your coding agent to inspect the project, select a supported transport, make the smallest instrumentation change, send a test event, and verify that it reached Agnost AI.
Install the skill once in your coding-agent environment:
Run the framework-specific prompt below from the application root. Review the resulting diff before deploying it.

Manual setup: Agnost AI SDK

agent.run() does not raise for model or provider failures. It returns a result with status="error", so result.is_done() is what marks the interaction as failed. Call agnost.shutdown() once when the application exits, not after each request. Shutting down per request disables telemetry for later agent runs in the same process.

Manual setup: OpenTelemetry

Browser Use 1.0 runs on Pydantic AI, and its documented tracing route is Pydantic AI’s OpenTelemetry instrumentation. Each run emits an invoke_agent span, a chat <model> span per model request, and an execute_tool python span for every Python cell the agent runs. These spans use the OTel GenAI conventions, so Agnost AI ingests them as they are.

Install

Setup

Pydantic AI writes a fresh gen_ai.conversation.id on every run, and Browser Use does not let you pass your own. BaggageSpanProcessor copies the agnost.session_id and agnost.user_id baggage onto every span started inside run_task, and Agnost AI reads agnost.session_id before gen_ai.conversation.id. That is how runs for the same user session land in one conversation. instrument_all() must run before the first Agent is created. Keep the default Browser() (Browser Use Cloud) if you use it; Browser("chromium") above runs a local browser.

What appears in Agnost AI

  • Conversations grouped by agnost.session_id.
  • User-level analytics grouped by agnost.user_id.
  • Events for the agent run (agent), each model request (chat), and each tool call (python for the cells the agent writes, plus Pydantic AI’s output tool).
  • The task as input and the final answer as output on the agent event. The python tool events carry the code the model wrote and what the cell printed.

Verify

Run one task, then open Events in Agnost AI. Confirm the conversation shows your session ID and user ID, an agent event with the task and the final answer, and a python tool event for each cell.

Troubleshooting

  • No events: confirm instrument_all() runs before any Agent is created and that the exporter has X-Agnost-Org-ID. Call provider.shutdown() (or force_flush()) before a short script exits.
  • Every run is its own conversation: the baggage was not attached around agent.run(). Attach it before the run starts, in the same task, as shown above.
  • One extra chat event per run: that is Browser Use’s judge, which grades the run with the same model. Pass Agent(..., judge=False) to turn it off.
  • Spans carry the task, the code the model writes, and page text it reads. Pass InstrumentationSettings(tracer_provider=provider, include_content=False) to keep message content out of the spans.
  • ANONYMIZED_TELEMETRY controls Browser Use’s own usage telemetry. It does not affect these traces.
  • Browser Use 0.x hooks (on_step_start, on_step_end) and the Laminar and OpenLIT integrations are gone in 1.0. Use the Pydantic AI spans above.

References

Next steps

  • Conversations: review the complete Browser Use run.
  • Events: inspect model requests and the Python cells the agent ran.
  • Patterns: organize production conversations by what users wanted.