InfluxDB integration for BrowserStack Load Testing
Learn how to send BrowserStack Load Testing metrics to InfluxDB and visualize them in Grafana, so you can correlate load-test activity with your application telemetry.
Use this guide to connect BrowserStack Load Testing with InfluxDB and Grafana. BrowserStack pushes load-test metrics to your InfluxDB bucket every 10 seconds, creates a per-test Grafana dashboard for you, and posts test lifecycle events as annotations on that dashboard.
For an overview of all APM options, see Application Performance Monitoring integration.
Prerequisites
Before you start, make sure you have:
- InfluxDB account: An InfluxDB account with at least one organization and one bucket.
- Grafana organization: A Grafana organization with an InfluxDB-typed data source already added under Connections > Data sources.
- BrowserStack Load Testing account: Access with admin permission to at least one project.
- About 10 minutes: Time to collect seven credential values and paste them into BrowserStack.
The integration works against any reachable InfluxDB and Grafana, including managed SaaS (InfluxDB Cloud, Grafana Cloud), self-hosted, and on-premise. The required fields and scopes are the same. You provide your own URLs.
Integration overview
BrowserStack Load Testing pushes 21 standard metrics to your InfluxDB bucket every 10 seconds during a test run, and posts 10 lifecycle event types as Grafana dashboard annotations. Metrics live in InfluxDB, and the dashboard and annotations live in Grafana.
Core capabilities:
- Metric streaming: BrowserStack aggregates performance data into 10-second time windows and writes it to your InfluxDB bucket over HTTPS.
- Auto-managed dashboard: BrowserStack creates a per-test Grafana dashboard the first time it sees metrics for that test, and keeps it in sync on subsequent runs.
- Lifecycle annotations: BrowserStack posts a Grafana annotation for each test event (such as test started or ramp up started), so you can align metric changes with what happened during the run.
-
Scoped annotations: Annotations carry a
dashboard-id:<your-dashboard-uid>tag, so events for one load test only appear on that test’s dashboard.
Supported metrics
BrowserStack pushes all 21 supported metrics automatically after you connect the InfluxDB integration. You do not need to enable individual metrics.
| Category | Metric name | Description |
|---|---|---|
| Load | browserstack.vu.max |
Maximum virtual users seen in the time window |
| Load | browserstack.vu.started |
Virtual users that started during the window |
| Load | browserstack.vu.ended |
Virtual users that completed during the window |
| Load | browserstack.test.duration |
Elapsed test time |
| Requests | browserstack.requests.rate.avg |
Average requests per second |
| Requests | browserstack.requests.count.total |
Total requests in the window |
| Errors | browserstack.errors.percentage |
Error rate as a percentage |
| Errors | browserstack.errors.count.total |
Total errored requests |
| Response | browserstack.response.time.avg |
Mean response time in milliseconds |
| Response | browserstack.response.time.p75 |
75th percentile response time |
| Response | browserstack.response.time.p90 |
90th percentile response time |
| Response | browserstack.response.time.p95 |
95th percentile response time |
| Response | browserstack.response.time.p99 |
99th percentile response time |
| Response | browserstack.response.time.max |
Maximum response time |
| Browser | browserstack.browser.lcp |
Largest Contentful Paint (web vitals) |
| Browser | browserstack.browser.fcp |
First Contentful Paint |
| Browser | browserstack.browser.plt |
Page load time |
| Browser | browserstack.browser.network.calls.total |
Browser network call count |
| System | browserstack.system.cpu.usage |
Engine CPU usage |
| System | browserstack.system.memory.usage |
Engine memory usage |
| System | browserstack.system.network.bandwidth |
Engine network bandwidth |
Every metric carries these tags: test_id, dashboard_id, load_test_name, region, and executorname.
Lifecycle events
BrowserStack posts one Grafana annotation per lifecycle event, color-coded for quick scanning.
| Event | When it fires |
|---|---|
test_started |
Test transitions from queued to running |
test_completed |
Test reaches a terminal success state |
test_failed |
Test reaches a terminal failure state |
test_stopped |
A user manually stops the test |
iteration_started |
A test iteration begins (iteration-based load profile only) |
iteration_ended |
A test iteration completes |
rampup_started |
The ramp-up phase begins (ramping load profile only) |
rampdown_started |
The ramp-down phase begins |
scenario_start |
A multi-scenario test enters a scenario |
scenario_end |
A multi-scenario test exits a scenario |
Configure InfluxDB
You can configure InfluxDB from the BrowserStack UI or from the CLI. Select your preferred method:
Use the following steps to collect seven values, four from your InfluxDB instance and three from your Grafana, and paste them into the Connect form:
Open the InfluxDB Connect form
To open the Connect form:
- Navigate to the BrowserStack Load Testing dashboard.
- Click Integrations > APM apps > InfluxDB.
- Click Connect.
A form opens with seven fields. Keep this tab open while you collect the values in the following steps.
Get your InfluxDB endpoint URL
Your endpoint URL is the host URL of your InfluxDB instance. To find it:
- Open your InfluxDB console.
- Copy the URL from your browser’s address bar and keep only the host part (for example,
https://us-east-1-1.aws.cloud2.influxdata.com). - Paste it into the InfluxDB Endpoint URL field in BrowserStack.
Note your organization name
To find your organization name:
- In the InfluxDB console, look at the organization switcher in the top-left corner.
- Copy the organization name exactly as shown. The value is case-sensitive.
- Paste it into the Organization field in BrowserStack.
Pick or create a bucket
A bucket is where InfluxDB stores your time-series data. You can use an existing bucket, or create a new one named for load testing (for example, browserstack-load-tests). A dedicated bucket keeps BrowserStack data separate from your application metrics.
To pick or create a bucket:
- In the InfluxDB console, click Load Data > Buckets.
- Click Create Bucket to create a new bucket, or pick an existing one.
- Copy the bucket name.
- Paste it into the Bucket field in BrowserStack.
Create an API token
The API token authorizes BrowserStack to write metrics into the bucket you selected. To create it:
- In the InfluxDB console, click Load Data > API Tokens.
- Click Generate API Token > Custom API Token.
- Set a description such as
BrowserStack Load Testing. - Under Buckets, find the bucket from the previous step and check both Read and Write.
- Click Generate.
- Copy the token immediately. InfluxDB does not show it again.
- Paste it into the API Token field in BrowserStack.
The token requires write:buckets and read:buckets scopes on the bucket from the previous step. BrowserStack uses write to push metrics, and uses read when saving to verify that the token works.
Get your Grafana URL
Your Grafana URL is the host URL of your Grafana instance. To find it:
- Open Grafana.
- Copy your stack URL (for example,
https://myorg.grafana.net). - Paste it into the Grafana URL field in BrowserStack.
Create a Grafana service account API key
The Grafana API key lets BrowserStack create the dashboard and post annotations on your behalf. To create the key:
- In Grafana, click Administration > Users and access > Service accounts.
- Click Add service account.
- Name it
browserstack-load-testingand pick the role Editor. - Click Create.
- On the service-account detail page, click Add service account token.
- Set a display name and pick an expiration date. Rotate the key every 90 days.
- Click Generate token.
- Copy the
glsa_...token immediately. Grafana does not show it again. - Paste it into the Grafana API Key field in BrowserStack.
The default Editor role grants the four required scopes:
-
dashboards:createanddashboards:writeto create and update your load-test dashboard. -
annotations:writeto post lifecycle events. -
datasources:readto verify your data source UID at save time.
If you use a custom role, make sure that the role includes these scopes.
Find your Grafana data source UID
The UID tells BrowserStack which InfluxDB data source in your Grafana to point the dashboard at. Make sure this UID belongs to an InfluxDB-typed data source, not a Prometheus or other type. BrowserStack verifies the type at save time.
To find the UID:
- In Grafana, click Connections > Data sources.
- Click the InfluxDB data source that you want BrowserStack to use.
-
Look at your browser’s address bar. The UID is the last segment of the URL, as shown in the following example:
https://myorg.grafana.net/connections/datasources/edit/cflt8gnh3a8owc ^^^^^^^^^^^^^^ UID - Copy the UID.
- Paste it into the Grafana Datasource UID field in BrowserStack.
Save and verify
Click Save in the BrowserStack Connect form. BrowserStack runs a five-step health check that takes 2 to 5 seconds. You see one of the following results:
- A green Connected badge if all seven credentials are valid. You can now run a load test and view results in Grafana.
- A red error message identifying which field is wrong. Fix that field and click Save again. For common errors, see the Troubleshooting section.
You can enable InfluxDB by adding an integrations.influxdb block to your browserstack-load.yml file. This approach is useful for committing the integration to source control.
The CLI path uses the same seven credentials as the UI path. To keep secrets out of source control, store the InfluxDB API token and the Grafana API key in environment variables and reference them in your YAML.
Run your load test with this YAML using the given command:
Best practices:
- Store the InfluxDB API token and the Grafana API key in environment variables instead of hard-coding them in the YAML file.
- Match the
endpointUrlto the region where your InfluxDB instance is hosted, so BrowserStack writes data to the correct endpoint. - Use a dedicated bucket for BrowserStack metrics, so they do not mix with your application telemetry.
Verify the integration
After your next test run completes, confirm that data is flowing:
- In BrowserStack, open the test run’s detail page.
- Click APM Tools in the side panel.
- Locate the InfluxDB card and click Open in Grafana.
- Confirm that your Grafana dashboard opens in a new tab and shows panels for VU max, response time, and error percentage with data from the run.
Troubleshooting
The following table lists common errors and how to fix them.
| Symptom | Cause | Fix |
|---|---|---|
| Save fails with Invalid API token | InfluxDB token is wrong, revoked, or missing required scopes | Regenerate the token (see the Create an API token step). Make sure both Read and Write are checked for your bucket. |
| Save fails with Bucket not found | Bucket name typo, or the token does not have access to the bucket | Confirm the bucket name in InfluxDB (bucket names are case-sensitive), and confirm that the token’s scope covers this exact bucket. |
| Save fails with Organization not found | Organization name typo (case-sensitive) | Re-copy the name from the InfluxDB console’s organization switcher. |
Save fails with Datasource UID not found or the API key lacks datasources:read scope
|
Grafana returns 403 for both cases | Confirm the UID in Grafana (see the Find your Grafana data source UID step) and confirm that your service account has the Editor role or higher. |
Save fails with Datasource type mismatch, expected influxdb
|
The Datasource UID you pasted points to a different type, for example Prometheus | Select the InfluxDB-typed data source in Grafana and paste its UID. |
| Save fails with Grafana API key insufficient permissions | Service-account role does not grant dashboards:create, dashboards:write, or annotations:write
|
Promote the service account to Editor, or add a custom role that includes the four required scopes. |
| Save fails with Minimum Grafana version 9.x required | You are on an older Grafana that does not support the RBAC permissions endpoint | Upgrade Grafana to 9.0 or later. |
| Save succeeds, but no metrics appear in InfluxDB after a test run | API token has read scope only | Regenerate the token with both Read and Write checked. |
| Annotations appear in a single color instead of per-event colors | Browser cache on the dashboard | Hard-refresh the dashboard. Colors come from per-event annotation tracks and render correctly after refresh. |
| Cannot reach InfluxDB endpoint | Endpoint URL typo, network or firewall issue, or InfluxDB region down | Confirm the endpoint URL. To verify connectivity, run curl -I <your-endpoint-url>/health and check for a 200 OK response. |
How BrowserStack stores your credentials
BrowserStack encrypts all seven credentials at rest in the integrations service. The Load Testing service never sees the raw token or API key. It asks the integrations service to push metrics and create dashboards on your behalf. BrowserStack sends your credentials only to InfluxDB and Grafana, and never logs them or exposes them to other tools.
To revoke access at any time, navigate to Integrations > APM apps > InfluxDB in the BrowserStack Load Testing dashboard and click Disconnect.
Next steps
- Run a load test: See the Get started guide to run your first test.
- Customize the dashboard: Add panels for your application-specific metrics. BrowserStack does not overwrite panels that you create.
-
Set up alerts: Use Grafana alerting on the metrics that BrowserStack publishes. For example, alert if
browserstack.errors.percentageexceeds 5% during a scheduled test. See the Grafana alerting documentation. - Add Prometheus: Many teams run InfluxDB and Prometheus side by side. See Prometheus integration.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!