Files
browser-use/docs/development/monitoring/observability.mdx
Magnus Müller c57ca023aa Refactor documentation structure and add new sections
- Reformatted JSON structure in `docs.json` for better readability.
- Updated navigation paths for development-related documentation.
- Removed outdated `hooks.mdx` and `mcp-client.mdx` files.
- Added new `get-help.mdx`, `local-setup.mdx`, `contribution-guide.mdx`, and `observability.mdx` files to enhance developer resources.
- Introduced `telemetry.mdx` to clarify data collection practices and opt-out options.
- Updated `mcp-server.mdx` to reflect current capabilities and usage instructions.
2025-09-01 23:36:19 -07:00

59 lines
1.9 KiB
Plaintext

---
title: "Observability"
description: "Trace Browser Use's agent execution steps and browser sessions"
icon: "eye"
mode: "wide"
---
## Overview
Browser Use has a native integration with [Laminar](https://lmnr.ai) - open-source platform for tracing, evals and labeling of AI agents.
Read more about Laminar in the [Laminar docs](https://docs.lmnr.ai).
## Setup
Register on [Laminar Cloud](https://lmnr.ai) and get the key from your project settings.
Set the `LMNR_PROJECT_API_KEY` environment variable.
```bash
pip install 'lmnr[all]'
export LMNR_PROJECT_API_KEY=<your-project-api-key>
```
## Usage
Then, you simply initialize the Laminar at the top of your project and both Browser Use and session recordings will be automatically traced.
```python {5-8}
from browser_use import Agent, ChatOpenAI
import asyncio
from lmnr import Laminar, Instruments
# this line auto-instruments Browser Use and any browser you use (local or remote)
Laminar.initialize(project_api_key="...")
async def main():
agent = Agent(
task="open google, search Laminar AI",
llm=ChatOpenAI(model="gpt-4.1-mini"),
)
await agent.run()
asyncio.run(main())
```
## Viewing Traces
You can view traces in the Laminar UI by going to the traces tab in your project.
When you select a trace, you can see both the browser session recording and the agent execution steps.
Timeline of the browser session is synced with the agent execution steps, timeline highlights indicate the agent's current step synced with the browser session.
In the trace view, you can also see the agent's current step, the tool it's using, and the tool's input and output. Tools are highlighted in the timeline with a yellow color.
<img className="block" src="/images/laminar.png" alt="Laminar" />
## Laminar
To learn more about tracing and evaluating your browser agents, check out the [Laminar docs](https://docs.lmnr.ai).