Repository navigation
test(web-e2e): ship every Playwright test as a trace to Dash0 - #703
Conversation
A Playwright reporter ported from dash0's tests/e2e: one root span per test attempt (its own trace) with test.case.* semconv and lorekit.e2e.* attributes, a child per step. Typed values are redacted (Playwright titles fill() as Fill "<value>", which for sign-in is the test password), and stdout, stderr, attachment paths, username and hostname are not sent. Export reuses scripts/telemetry/otlp-export.mjs and the CLI's resolveTelemetryConfig (service.name=e2e, deployment.environment.name=test), once from onEnd, never failing the run. The Playwright CI steps get the existing LOREKIT_TELEMETRY_TOKEN.
|
Darkplane Automerge did not approve this pull request. It scored 66.14 of 100, and 75 was required.
The other 2 criteria
An AI evaluator produced these scores from the diff, the repository history, and the pull request text. The pull request text is author-controlled, so treat the scores as signals rather than proof. Reviewed for commit 31d5e51. |
✅ No issues foundThe new commit moves the redaction list into a tested pure function, buildRedactions, with no behaviour change. One advisory doc-wording note on the correlation key. 1 advisory finding below the confidence bar — see Less certain below. Checked: 11 of 11 changed files read · 0 of 3 dependent files traced · 1 possible issue → 0 confirmed → 0 posted Progress: open review threads 3 → 1 → 1 → 0 → 0 · blocking 1 → 0 → 0 → 0 → 0 across the last 5 reviews What this change reaches — 11 changed exports · 3 dependent files · 0 checked · 3 not checkedflowchart LR
subgraph pr["Changed in this PR"]
s1["OtlpEncoder<br/>added"]:::changed
s2["buildRedactions<br/>added"]:::changed
s3["buildTestSpans<br/>added"]:::changed
s4["loadOtlpExport<br/>added"]:::changed
s5["loadTelemetryConfig<br/>added"]:::changed
s6["OtlpSpan<br/>added"]:::changed
smore["+5 more changed exports<br/>listed below"]:::changed
end
s1c1["packages/web-e2e/src/support/ · 2 files<br/>✓ checked"]:::ok
s1c2["packages/web-e2e/src/otel-spans.test.ts<br/>✓ checked"]:::ok
s2c1["packages/web-e2e/src/otel-spans.test.ts<br/>✓ checked"]:::ok
s2c2["packages/web-e2e/src/support/otel-reporter.ts<br/>✓ checked"]:::ok
s3c1["packages/web-e2e/src/otel-spans.test.ts<br/>✓ checked"]:::ok
s3c2["packages/web-e2e/src/support/otel-reporter.ts<br/>✓ checked"]:::ok
s4c1["packages/web-e2e/src/otel-spans.test.ts<br/>✓ checked"]:::ok
s4c2["packages/web-e2e/src/support/otel-reporter.ts<br/>✓ checked"]:::ok
s5c1["packages/web-e2e/src/otel-spans.test.ts<br/>✓ checked"]:::ok
s5c2["packages/web-e2e/src/support/otel-reporter.ts<br/>✓ checked"]:::ok
s6c1["packages/web-e2e/src/support/ · 2 files<br/>? not checked"]:::unknown
s1 --> s1c1
s1 --> s1c2
s2 --> s2c1
s2 --> s2c2
s3 --> s3c1
s3 --> s3c2
s4 --> s4c1
s4 --> s4c2
s5 --> s5c1
s5 --> s5c2
s6 -.-> s6c1
classDef changed fill:#eef2ff,stroke:#6366f1,color:#1e1b4b
classDef ok fill:#e7f6ec,stroke:#16a34a,color:#14532d
classDef partial fill:#fef9c3,stroke:#ca8a04,color:#713f12
classDef unknown fill:#f3f4f6,stroke:#9ca3af,stroke-dasharray:4 3,color:#374151
classDef bad fill:#fde8e8,stroke:#dc2626,color:#7f1d1d
classDef warn fill:#fff4e5,stroke:#d97706,color:#78350f
classDef imports fill:#f8fafc,stroke:#64748b,stroke-dasharray:4 3,color:#1e293b
Less certain (1) — advisory, below the confidence bar
Review details
Found Quality — produced 1 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 1 Run full · 54 lines in delta · tier deep · depth checkout Nothing to report — severity, 0 files skipped.
|
…LP encoder as a test input; current code.* semconv
…or text; repo-relative code.file.path
…ncluded; pin the config contract
Why
The Playwright gates (PR, staged build, production) leave nothing behind once a run ends except a CI log. As traces, their durations, flakes and failures can be charted and searched across runs, next to the CLI/REST/MCP smokes they run alongside.
What changed
src/support/otel-reporter.ts: a Playwright reporter ported fromdash0/tests/e2e/config/otel-reporter.ts.test.case.*semconv andlorekit.e2e.{project,status,retry,flaky,duration_ms,tags,skip_reason}.WHEN/THENsteps, actions, expects, hooks). Fixture steps are folded away, and steps are capped at 250 per test.exceptionevent.NodeSDK, the reporter exports through the repo's existingscripts/telemetry/otlp-export.mjsand the CLI'sresolveTelemetryConfig, as the eval exporter does:Dash0-Datasetrouting and opt-outs;service.name=e2eand the hard-codeddeployment.environment.name=test;It sends once, from
onEnd, and a failed export never fails the run.E2E_OTEL_OUT=<file>writes the payload to a file.fill(x)asFill "x", which for the sign-in step is the test account's password. Values ofFill/Type/Insert/Press/Key up/Key downsteps are redacted to"…". The same values are scrubbed from error text, where a failed action's call log echoes them asfill("x"), and the configured secrets (E2E_USER_PASSWORD,LOREKIT_TESTING_USER_PW,E2E_SUPABASE_SERVICE_ROLE_KEY) are blanked from it. Afillthat timed out on a disabled input, run through the reporter, leaves the password nowhere in the payload. stdout, stderr, attachment paths, username and hostname are not sent (the dash0 version records them). Absolute paths in error messages and stack traces are rewritten, the repo root to relative and the home directory to~, so a failed local run does not ship the username.otel-spans.test.tspins all of this, includingbuildRedactions(the list the reporter builds from the configured secrets, the repo root and the home directory).web-e2e(ci.yml) ande2e-web-staged(deploy.yml) get the existingLOREKIT_TELEMETRY_TOKENplus aLOREKIT_CORRELATION_ID.smoke-productionalready has both job-wide.project.jsongainsimplicitDependencies: cli, because the reporter imports the CLI's telemetry config. Thetesttarget also lists{workspaceRoot}/scripts/telemetry/**/*as an input, alongside the inputs Nx infers, so a change to the shared encoder runsotel-spans.test.ts.docs/otel.md(a new section and aservice.nameinventory row),docs/smoke-tests.md, andCLAUDE.md's package map.How to verify
pnpm nx typecheck web-e2e,testandlintall pass.nx show projects --affected --files=scripts/telemetry/otlp-export.mjsreturnsweb-e2e.E2E_OTEL_OUT: the exported stack readspackages/web-e2e/src/…, with no/Users/path left.otel: exported 415 e2e spans for 35 test attempts. The spans show up in Dash0 (dev,defaultdataset) underservice.name=e2e, nested correctly.actionlint: no new findings in the touched workflows.Export follows the CLI's
resolveTelemetryConfig: it is on when a credential resolves (LOREKIT_TELEMETRY_TOKEN,OTEL_EXPORTER_OTLP_HEADERS) or an explicitOTEL_EXPORTER_OTLP_ENDPOINTis set (which needs no credential), so a local run with any of those sends too;LOREKIT_TELEMETRY=offopts out.User-facing docs/llms.txt: none applied, because this is test tooling and contributor docs only.