<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/playwright-test-observability-run-history-flakes-traces-ipd5adv9b" -->

---
title: Playwright Test Observability: Run History, Flakes, Traces
description: Building Playwright test observability means storing one event per test attempt, not one row per test, so flaky failures keep their error and duration. A...
canonical: https://daily.dev/posts/playwright-test-observability-run-history-flakes-traces-ipd5adv9b
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Playwright Test Observability: Run History, Flakes, Traces | daily.dev
og:description: Building Playwright test observability means storing one event per test attempt, not one row per test, so flaky failures keep their error and duration. A...
og:url: https://daily.dev/posts/playwright-test-observability-run-history-flakes-traces-ipd5adv9b
og:image: https://api.daily.dev/og/posts/iPd5ADv9B.png
og:image:alt: Playwright Test Observability: Run History, Flakes, Traces
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Playwright Test Observability: Run History, Flakes, Traces

**[Currents](https://daily.dev/sources/currents)** · 19 min read · 0 upvotes · 0 comments

## Summary

Building Playwright test observability means storing one event per test attempt, not one row per test, so flaky failures keep their error and duration. A custom reporter keyed on test ID and retry number writes to a database, since GitHub Actions only keeps artifacts for 90 days by default. From that data you can compute flake rate and retry rate, and p95 duration on passing attempts only since Playwright's default 30-second timeout would otherwise inflate the tail. Setting trace to 'retain-on-failure' keeps a trace for any failed attempt even after a retry passes, and per-attempt trace IDs sent via extraHTTPHeaders link failures to backend traces.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://currents.dev/posts/playwright-test-observability-run-history-flakes-traces>

## Questions this post answers

### How do I track Playwright test flakiness across multiple CI runs instead of just one run?

Write one event per test attempt from a custom reporter, keyed on the test ID and retry number, and store it in a database with a unique key on run ID, test ID and retry. Across runs, a test counts as flaky when it passed in one run and failed in another on the same commit, computed over a rolling window like 30 days.

_daily.dev surfaces practical approaches like this for teams debugging flaky CI suites over time._

### Why shouldn't I compute Playwright test p95 duration using every test attempt?

An attempt that hit its timeout, 30 seconds by default in Playwright Test, consumes the full timeout across the test function, fixture setups and beforeEach hooks, which inflates the tail. Compute p95 only on passing attempts and compare two equal windows, such as the last 30 days against the previous 30, to see real slowdowns.

_Engineers tuning test suite performance can find this kind of query pattern on daily.dev._

### How do I link a failed Playwright test to the backend trace for the request that broke it?

Send a trace ID as a header using extraHTTPHeaders, overridden in a fixture that generates a new ID for every attempt rather than once per run, and make sure the backend's tracing reads that header. Attach the trace link to the test via testInfo.attach() with body rather than path, since the link is a value, not a file.

_daily.dev helps developers wiring frontend test failures to backend observability track solutions like this._

## Similar posts on daily.dev

- [Playwright Trace Viewer: Debug CI Failures Step by Step](https://daily.dev/posts/playwright-trace-viewer-debug-ci-failures-step-by-step-8b1r8sxxe) · Currents · 3 upvotes · 0 comments
- [Playwright Flaky Tests: Detect Them in CI with Retries](https://daily.dev/posts/playwright-flaky-tests-detect-them-in-ci-with-retries-vamwlvpg0) · Currents · 1 upvotes · 1 comments
- [Stop restarting your tests](https://daily.dev/posts/stop-restarting-your-tests-ns9dk3caa) · Temporal · 0 upvotes · 0 comments
- [How to analyze Playwright traces](https://daily.dev/posts/how-to-analyze-playwright-traces-zowzprzht) · RUBYLAND · 0 upvotes · 0 comments
- [The Industry Is Solving Flaky Tests Backwards](https://daily.dev/posts/the-industry-is-solving-flaky-tests-backwards-gsp5zpcqq) · SD Times · 0 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#testing](https://daily.dev/tags/testing), [#cicd](https://daily.dev/tags/cicd)

[View this post on daily.dev](https://daily.dev/posts/playwright-test-observability-run-history-flakes-traces-ipd5adv9b)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Playwright Test Observability: Run History, Flakes, Traces","url":"https://daily.dev/posts/playwright-test-observability-run-history-flakes-traces-ipd5adv9b","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/playwright-test-observability-run-history-flakes-traces-ipd5adv9b"},"datePublished":"2026-10-28T16:03:53.687Z","dateModified":"2026-10-28T16:13:02.467Z","description":"Building Playwright test observability means storing one event per test attempt, not one row per test, so flaky failures keep their error and duration. A...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/160b7a1cbb3cf95b5421c43b4d3ccd0a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/160b7a1cbb3cf95b5421c43b4d3ccd0a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Currents","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Currents","logo":"https://media.daily.dev/image/upload/s--RxsiMZ1S--/f_auto,q_auto/v1788684994/logos/currents?_a=BAMAMicg0","url":"https://daily.dev/sources/currents"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/playwright-test-observability-run-history-flakes-traces-ipd5adv9b","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,testing,cicd","timeRequired":"PT19M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Currents","item":"https://daily.dev/sources/currents"},{"@type":"ListItem","position":3,"name":"Playwright Test Observability: Run History, Flakes, Traces"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/playwright-test-observability-run-history-flakes-traces-ipd5adv9b#faq","mainEntity":[{"@type":"Question","name":"How do I track Playwright test flakiness across multiple CI runs instead of just one run?","acceptedAnswer":{"@type":"Answer","text":"Write one event per test attempt from a custom reporter, keyed on the test ID and retry number, and store it in a database with a unique key on run ID, test ID and retry. Across runs, a test counts as flaky when it passed in one run and failed in another on the same commit, computed over a rolling window like 30 days. daily.dev surfaces practical approaches like this for teams debugging flaky CI suites over time."}},{"@type":"Question","name":"Why shouldn't I compute Playwright test p95 duration using every test attempt?","acceptedAnswer":{"@type":"Answer","text":"An attempt that hit its timeout, 30 seconds by default in Playwright Test, consumes the full timeout across the test function, fixture setups and beforeEach hooks, which inflates the tail. Compute p95 only on passing attempts and compare two equal windows, such as the last 30 days against the previous 30, to see real slowdowns. Engineers tuning test suite performance can find this kind of query pattern on daily.dev."}},{"@type":"Question","name":"How do I link a failed Playwright test to the backend trace for the request that broke it?","acceptedAnswer":{"@type":"Answer","text":"Send a trace ID as a header using extraHTTPHeaders, overridden in a fixture that generates a new ID for every attempt rather than once per run, and make sure the backend's tracing reads that header. Attach the trace link to the test via testInfo.attach() with body rather than path, since the link is a value, not a file. daily.dev helps developers wiring frontend test failures to backend observability track solutions like this."}}]}
```

