browser automation failed when the agent opened the workers observability tab: charts lazy-load on scroll
Fixes browser automation that fails on the Cloudflare Workers observability tab because charts lazy-load on scroll. Use when the agent cannot read metrics dashboards that render on scroll. Not for login failures, API-based metrics, or dashboards that fail to load at all.
TL;DR
The observability tab renders charts only when scrolled into view. The agent screenshotted or scraped immediately, saw empty chart containers, and concluded there was no data. Scroll each chart into view, wait for the render, then capture. Better: skip the browser entirely and pull the same metrics from the API.
The query
browser automation failed when the agent opened the workers observability tab: charts lazy-load on scrollUse this when
- The agent reports 'no data' on a dashboard that shows data to humans.
- Chart containers are empty in the agent's capture.
- The failure is specific to scrollable dashboards.
Not for
- Cloudflare login or SSO failures in automation (auth problem).
- Dashboards that never load even for humans (outage or permissions).
- Metrics available via API (just use the API).
Steps
Step 1: Confirm it is lazy-loading, not missing data
Have the agent scroll down slowly and re-capture after each scroll.
Expected result: charts populate as they enter the viewport. The data was always there; the capture was too early.
Step 2: Script the scroll-then-capture sequence
For each chart region: scroll into view, wait for network idle or a fixed delay, then capture.
Expected result: complete dashboard data in the agent's captures. The sequence is deterministic.
Step 3: Prefer the metrics API over the browser
The dashboard is a view over API data. Query the analytics API directly for invocations, errors, latency, and subrequests.
Expected result: structured numbers with no rendering involved. Faster, more reliable, and scriptable.
Step 4: Reserve browser automation for what needs it
Use the browser only for interactions with no API equivalent. Metrics reading is not one of those.
Expected result: the agent's browser usage shrinks to genuine UI tasks. Flakiness drops.
Step 5: Document the dashboard's loading behavior
Expected result: the runbook notes which dashboards lazy-load and the API alternative for each. The next agent does not rediscover this.
Why it happens
Modern dashboards optimize for humans: render what is visible, defer the rest. Automation that captures immediately races the lazy loader and loses. The agent correctly reported what it saw (empty charts); what it saw was not the whole page.
Edge cases
- Time-range selectors also reload charts. Set the range first, then scroll-capture.
- Some charts load on tab-switch, not just scroll. Activate each tab before capturing.
- API rate limits apply to metrics queries too. Cache results within a run instead of re-querying per chart.
- If the agent must use the browser, disable animations to make render-complete detection reliable.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_m3-xX8nsPsTDFzJ9ILLSmg