Browserbase session monitoring
On Browserbase, the API and dashboard give you live views, recordings, and session metadata.
Live session visibility
Browserbase provides real-time visibility into your automation sessions: Session dashboard features- Real-time browser screen recording and replay
- Network request monitoring with detailed timing
- JavaScript console logs and error tracking
- CPU and memory usage metrics
- Session status and duration tracking
- TypeScript
- Python
- Go
Session analytics & insights
Real-time monitoring
Monitor live session status, resource usage, and geographic distribution. Scale and manage concurrent sessions with real-time insights.
Session recordings
Review complete session recordings with frame-by-frame playback. Analyze network requests and debug browser interactions visually.
API management
Programmatically access session data, automate lifecycle management, and integrate with monitoring systems through the Browserbase API.
Usage monitoring
Track resource consumption, session duration, and API usage. Get detailed breakdowns of costs and utilization across your automation.
Session monitoring & filtering
Query and monitor sessions by status and metadata:- TypeScript
- Python
- Go
Local environment monitoring
For local development, Stagehand provides performance monitoring and resource tracking capabilities directly on your machine.Performance tracking
- TypeScript
- Python
- Go
Resource usage monitoring
When running locally, monitor system resource usage and browser performance:- TypeScript
- Python
- Go
Speed and cost tuning
Monitor token usage, costs, and speed. Set up automated alerting for critical failures. Implement cost tracking across different environments. Use session analytics to optimize automation workflows.
Real-time metrics & monitoring
Basic usage tracking
Monitor your automation’s resource usage in real-time by calling the metrics method:- TypeScript
- Python
- Go
Understanding metrics data
The metrics object provides a detailed breakdown by Stagehand operation:- TypeScript
- Python
- Go
- TypeScript
- Python
- Go
Cached input tokens are reported separately so you can see how much of your prompt spend was served from your provider’s prompt cache. This is distinct from Stagehand’s own server-side result cache, which avoids the inference call entirely.
Operation history
Metrics give you the totals. When you want the sequence of what happened, build the timeline yourself from the log callback: every act, observe, and extract emits records with their structured data already attached. There is no history accessor on theStagehand instance.
- TypeScript
- Python
- Go
The records you capture depend on the level. Raise it to
debug for the fullest timeline; the default is info and above.Tracing
Stagehand emits OpenTelemetry spans for every operation and for every log record, and propagates W3C trace context across the SDK and runtime boundary. Point it at your own OTLP collector to see full traces alongside the rest of your system.- TypeScript
- Python
- Go
Spans are tagged with a span type:
operation spans wrap act, observe, and extract, and record exceptions and error status; log spans carry the structured data from each log record. Traces are sampled at 100%.Best practices
Production monitoring
Production monitoring
- Track session success rates and failure patterns
- Monitor resource usage and scaling requirements
- Set up automated alerting for critical failures
- Implement cost tracking across different environments
- Use session analytics to optimize automation workflows
Performance optimization
Performance optimization
- Compare Browserbase vs local execution times
- Monitor token usage and inference costs across models
- Track geographic performance differences
- Identify bottlenecks in automation workflows
- Optimize for cost-effectiveness and speed
Operational insights
Operational insights
- Track session distribution across regions
- Monitor concurrent session limits and scaling
- Analyze failure patterns and common error scenarios
- Use session recordings for root cause analysis
- Implement custom metadata for workflow categorization
Integration & alerting
Integration & alerting
- Integrate session APIs with monitoring dashboards
- Set up automated notifications for session failures
- Track SLA compliance and performance benchmarks
- Monitor resource costs and usage patterns
- Use analytics data for capacity planning and optimization
Next steps
Caching
Cut token spend and latency by serving repeated act, observe, and extract calls from the server-side cache.
Logging
Configure logging levels, custom loggers, and file-based session logging.

