Skip to main content

/metrics API

The metrics API returns an array of session statistics. Data covers a maximum of 1 week.

Private fleet customers

Call /metrics on your dedicated fleet URL (e.g., chrome.browserless.io), not on production-sfo.browserless.io. Using the shared fleet URL with a private fleet token will not return your fleet's data.

Metrics reset after a Relaunch. estimatedMonthlyUnits will be unreliable for several hours on a freshly launched fleet. For reliable unit consumption tracking, use the GraphQL exportMetrics query.

Gathering metrics from your workers

Issue a GET request to /metrics to retrieve session statistics:

curl -X GET \
https://production-sfo.browserless.io/metrics?token=YOUR_API_TOKEN_HERE
warning

Running this in the browser exposes your API key.

Running this request will result in an output like:

[
{
"error": 3,
"maxConcurrent": 4,
"queued": 0,
"rejected": 0,
"running": 3,
"sessionTimes": [992, 1041, 802],
"successful": 0,
"timedout": 0,
"unauthorized": 0,
"unhealthy": 0,
"maxTime": 1041,
"meanTime": 945,
"minTime": 802,
"totalTime": 2835,
"units": 3,
"date": 1709134233732,
"cpu": 0.024877870173220466,
"memory": 0.7784158564199399
},
// ...
]

/metrics/total

This route will output a similar payload, but with the total stats of all sessions.