vitest-dev / vitest-dev/vitest

OpenTelemetry: support tracking fixtures

Open
#9,042 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feat: open telemetry p2-nice-to-have
Dominant language
TypeScript
Stars
17.1k
Forks
2k
Avg merge
1d 22h
Merged PRs (30d)
94

Description

Clear and concise description of the problem

Currently, fixtures are not properly tracked as separate spans so it's hard to pinpoint which fixture takes the longest time.

Suggested solution

Track fixtures. The main issue right now is that we cannot use startActiveSpan and pass down the context properly because fixture resolution is split into separate promises:

https://github.com/vitest-dev/vitest/blob/259a3d1b563ecafa51ced4641218545dab635be7/packages/runner/src/fixture.ts#L282

We could reuse startContextSpan, but then users won't be able to inherit the context.

Alternative

No response

Additional context

No response

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/runner/src/fixture.ts around line 282, where fixture resolution is split across promises. Read the existing startActiveSpan and startContextSpan usage and trace how fixture resolution passes context. Done means each fixture is represented as a separate OpenTelemetry span while preserving inherited user context.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
observability, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.