Repository navigation
docs(examples): add a Grafana LGTM stack for telemetry mode - #556
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The stack, bucket, CORS and dashboard provisioning work. Blocking: the metric panels miss late pushes. A span that ended more than about 3 minutes before the push counts 0 in every Small items:
|
362bb09 to
2f31b16
Compare
2f31b16 to
9057204
Compare
[Medium impact] The PR appears safe to merge, with three earlier non-blocking fixes still recommended. FindingsSummaryAdds a local Grafana stack for viewing exported test runs.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Tests["Test run"] --> Manifest["Artifacts manifest"]
Tests --> Zips["Optional trace zips"]
Manifest --> CLI["wdio-otel push"]
Zips --> CLI
CLI --> Tempo["Tempo"]
Tempo --> Grafana["Grafana dashboard"]
Zips --> Bucket["Local bucket"]
Grafana --> Player["Trace player"]
Bucket --> Player
Reviews (6) · Last reviewed commit: "Merge remote-tracking branch 'origin/ote..." · Reviewed by Greptile |
| }, | ||
| "queryType": "traceql", | ||
| "metricsQueryType": "instant", | ||
| "query": "{ resource.service.name=\"devtools-tests\" && span.test.case.result.status != nil && span.devtools.test.final_attempt = true } | max_over_time(span.devtools.duration_ms) by (trace:id, span.test.case.name, span.test.case.result.status, span.devtools.failed_action, span.devtools.artifact.url)" |
There was a problem hiding this comment.
In telemetry mode, two tests with the same title in different files have no artifact URL or failed action. Under one TRACEPARENT, they also share trace:id. If their statuses match, every grouping field is identical, so max_over_time merges them and keeps only the longer duration. Add span.devtools.test.uid and span.session.id to the grouping fields so each test execution stays separate.
| "query": "{ resource.service.name=\"devtools-tests\" && span.test.case.result.status != nil && span.devtools.test.final_attempt = true } | max_over_time(span.devtools.duration_ms) by (trace:id, span.test.case.name, span.test.case.result.status, span.devtools.failed_action, span.devtools.artifact.url)" | |
| "query": "{ resource.service.name=\"devtools-tests\" && span.test.case.result.status != nil && span.devtools.test.final_attempt = true } | max_over_time(span.devtools.duration_ms) by (trace:id, span.devtools.test.uid, span.session.id, span.test.case.name, span.test.case.result.status, span.devtools.failed_action, span.devtools.artifact.url)" |
| } | ||
| ], | ||
| "id": 4, | ||
| "description": "Counts tests that passed after a retry inside one worker process. specFileRetries retries in a fresh worker and are not counted.", |
There was a problem hiding this comment.
Retry label misstates the count
The Flaky panel says specFileRetries are not counted, but its query includes every passing attempt numbered above zero. The service preserves the fresh worker's attempt number, and this PR's README correctly says those retries are counted. Update the title and description to include both retry types.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| 3. Upload the output directory to the bucket (see the recipes below). Skip this when you only want the telemetry; the replay link and `--trace-zips` need the zips. | ||
| 4. Push the telemetry after the run: | ||
| ```sh | ||
| npx wdio-otel push test-results/devtools-artifacts-*.json \ |
There was a problem hiding this comment.
The setup steps never tell users to install @wdio/opentelemetry before running npx wdio-otel. If the package is not already installed, npx looks for wdio-otel rather than the intended package. Add an install prerequisite or use npx --package=@wdio/opentelemetry wdio-otel push .... The GitHub Actions example needs the same prerequisite.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A push above about 15,000 spans started more than 30 exports at once, the exporter refused the rest, and half the run was lost behind an exit code. Batches now go one at a time and a failure says how many spans arrived. Spans carry the session, browser, test uid and CI commit, branch and pipeline, and test.suite.name is relative to where the tests ran, so history matches across machines. A failure in one browser is no longer superseded by a later pass in another, a test with no outcome is pushed instead of dropped, and a malformed manifest names the field at fault. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…he run Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
An end-to-end run showed the attempt span marked failed with no error.message: mocha only sets the error on a test it reports as failed, and a retried attempt is never reported. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… 3000 Tempo's defaults hid two kinds of pushed run. Spans that ended more than two minutes before the push were left out of TraceQL metrics and windowed search, and traces past 10000 live per tenant were dropped while the push still got a success answer. The example now mounts a Tempo config that lifts both, measured with pushes up to 97 minutes old and two 20000-test pushes in a row. Grafana moves to host port 3001 because 3000 is the live dashboard backend's default. The README states that the bucket is readable without credentials, and the wdio example configs set emitArtifactsManifest only in the modes that honour it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The reader accepts only manifestVersion 2, checks it before anything else, and no longer needs cwd. Sampling follows the parent unless --ignore-parent-sampling is given, and a manifest skipped for that reason is reported. Console text is exported only with --console-messages and is capped. A zip outside the manifest directory, by path or through a symlink, is not read. Manifests keep their own run ids, and a push of spans older than an hour says so. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…comment The config check printed several slack values without saying which one matters, and the config header ran to two lines. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Only a per-test zip names its attempt in its folder. A session or spec zip covers every attempt of its tests, but was matched as attempt 0, so a test that passed on a retry got no replay link and nothing said so. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
9057204 to
9bf1d24
Compare
# Conflicts: # examples/selenium-js/cucumber/features/support/setup.js # examples/wdio/mocha/wdio.conf.ts
Stack
Part 4 of 4 of the OpenTelemetry export, replacing #485. Stacked on part 3.
What
examples/o11y: a Grafana LGTM stack (Tempo, MinIO bucket and a dashboard) for viewing pushed runs. Its replay links open the hosted player,https://trace.webdriver.io/?trace=<zip URL>, and aplayer_basevariable points them at a self-hosted player. The bucket's CORS rule allows trace.webdriver.io.traceGranularity,tracePolicy, the screencast) only whenDEVTOOLS_MODE=trace, so live and telemetry runs no longer warn about options they ignore.Caveats
https:zip URLs. The local bucket ishttp://127.0.0.1:9000, so one-click replay needs an https bucket. Locally, download the zip and drop it onto the player.Verification
pnpm build,pnpm lint(0 errors) andpnpm docs:capabilities --checkpass. This branch changes nothing underpackages/. One fullpnpm testrun had 4158 passed, 4 skipped and 1 failed:run-start-broadcast.test.tswithEADDRINUSE 127.0.0.1:3000, which passes when run alone.Not done here: mirroring the README changes to the webdriverio website docs.
🤖 Generated with Claude Code