Skip to content

Push the run to OpenTelemetry from the WDIO service launcher - #642

Open
Winify wants to merge 4 commits into
mainfrom
feat/otel-launcher-push
Open

Winify wants to merge 4 commits into
mainfrom
feat/otel-launcher-push

Conversation

@Winify

@Winify Winify commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Adds an otel option to the WebdriverIO devtools service. In onComplete the launcher pushes this run's artifacts manifests (selected by DEVTOOLS_RUN_ID and mtime) to an OTLP collector through @wdio/opentelemetry, so CI needs no separate wdio-otel push step.

  • @wdio/opentelemetry exports loadManifests and pushManifests; the CLI uses them.
  • The package is an optional peer, loaded with a dynamic import and a 30 s limit. The outcome prints as [devtools] ... on the terminal.
  • Ignored in live mode, with a warning.
  • Capability row otel-push: Nightwatch and Selenium are marked CLI-only.

Verified with a real run against a local Tempo/Grafana stack: 2 WDIO tests passed, [devtools] pushed 2 test(s) from 2 manifest(s) across 1 run(s) printed, both traces in Tempo with action children, artifact URLs returned 200.

Why isn't this in core? Only the WDIO launcher has an end-of-run hook in the main process wired so far; Nightwatch and Selenium keep the CLI until a second adapter needs it.

🤖 Generated with Claude Code

Winify and others added 3 commits December 1, 2026 10:57
Other tools, starting with the WebdriverIO service, need to push artifacts manifests in-process instead of spawning the wdio-otel CLI. The CLI now parses arguments and prints, and delegates the push to the same API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the new otel option set, the launcher pushes the manifests of the current run in onComplete, so WebdriverIO users need no separate CLI step in CI. @wdio/opentelemetry stays an optional peer loaded on demand, a failed push never changes the run's exit code, and the outcome prints to the terminal because launcher logger output did not show in a real run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The o11y example now uses the otel option instead of the bash push steps, and sets DEVTOOLS_RUN_ID before building artifact URLs so the uploaded folder and the span's run id always agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
devtools Ready Ready Preview Dec 1, 2026 10:51am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; both previous findings are addressed.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are addressed.

Summary

Adds an optional OpenTelemetry push when the WebdriverIO run ends.

  • The WebdriverIO service pushes this run’s manifests to OpenTelemetry when the run ends.
  • Code callers can load manifests and push them through the OpenTelemetry package.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["Workers write manifests"] --> B["Launcher onComplete"]
  B --> C["Select manifests by run ID and write time"]
  C --> D["Load optional @wdio/opentelemetry"]
  D --> E["Push spans to OTLP collector"]
  E --> F["Print result or warning"]
Loading

Reviews (2) · Last reviewed commit: "Correct the env and CI artifact URL docs..." · Reviewed by Greptile

Comment thread packages/otel/src/push.ts
realpath: (target) => realpathSync(target),
warn
})
const telemetry = createTelemetry({ dryRun, ignoreParentSampling, env })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Supplied collector settings are ignored

When a caller supplies collector settings through env, createTelemetry uses that object only for CI attributes. OTLPTraceExporter receives no settings, and envDetector reads the process environment instead. The push can therefore use the wrong endpoint, headers, and service name, contrary to the new API's documented behavior. Pass the supplied settings through to the exporter and resource setup.

Comment thread examples/o11y/README.md
```

On GitHub Actions the CLI reads the branch, commit and run from the runner's own variables, so the job sets no `OTEL_RESOURCE_ATTRIBUTES`; a key set there replaces the detected one. `--run-id ${{ github.run_id }}` groups every manifest of the job under one run, and a re-run of the job reuses that id.
On GitHub Actions the push reads the branch, commit and run from the runner's own variables, so the job sets no `OTEL_RESOURCE_ATTRIBUTES`; a key set there replaces the detected one. `DEVTOOLS_RUN_ID` is both the upload folder and the spans' `devtools.run.id`, so a re-run of the job reuses it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 CI replay links point locally

The GitHub Actions example no longer supplies the hosted bucket URL after removing the CLI push step. Following the service configuration above records http://127.0.0.1:9000/traces/... links, while the job uploads to S3. Readers get replay links pointing at their own computer rather than the uploaded traces. Show a CI-specific otel.artifactBaseUrl using the bucket's HTTPS address, and update the remaining --artifact-base-url guidance to name the service option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant