Grafana Labs has detailed a new approach for monitoring Cypress test suites by transforming test results into Prometheus metrics and forwarding them to Grafana Cloud. The technique, outlined in a blog post, aims to move beyond the limitations of terminal output or CI logs, which only show results from individual executions.
The method leverages Cypress lifecycle hooks—specifically the before:run and after:spec events—to capture data such as pass and failure counts, test states, and durations. This information is converted into a small set of Prometheus metrics covering individual tests, specifications, and complete test runs.
Because Cypress jobs are short-lived, the metrics are pushed to a Prometheus Pushgateway, which temporarily holds them long enough for Grafana Alloy to scrape and forward to Grafana Cloud. Once in Grafana Cloud, teams can visualize the data on dashboards and set up alerts. This enables answers to questions like whether a specific specification is getting slower, whether a test has started failing intermittently, or if overall suite performance is degrading.
The approach also supports attaching GitHub Actions run identifiers to metrics, allowing any metric change to be traced back to the CI execution that produced it. Grafana recommends treating this telemetry as a side effect of the test rather than part of the test outcome, meaning that anerror in publishing metrics should not cause a test run to be marked as failed.
The publication reflects a broader trend in engineering: treating test results not just as reporting artifacts but as operational data that lives alongside production telemetry. By exporting test metrics into the same observability environment, teams gain a more unified view of software quality and performance over time.