MCPcopy
hub / github.com/vitest-dev/vitest / startTracesSpan

Method startTracesSpan

packages/vitest/src/node/pools/poolRunner.ts:134–147  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

132 }
133
134 startTracesSpan(name: string): Span {
135 const traces = this._traces
136 if (!this._otel) {
137 return traces.startSpan(name)
138 }
139 const { span, context } = traces.startContextSpan(name, this._otel.workerContext)
140 this._otel.currentContext = context
141 const end = span.end.bind(span)
142 span.end = (endTime?: TimeInput) => {
143 this._otel!.currentContext = undefined
144 return end(endTime)
145 }
146 return span
147 }
148
149 request(method: 'run' | 'collect', context: WorkerExecuteContext): void {
150 this._otel?.files.push(...context.files.map(f => f.filepath))

Callers 3

startMethod · 0.95
stopMethod · 0.95
scheduleMethod · 0.80

Calls 3

startSpanMethod · 0.80
startContextSpanMethod · 0.80
bindMethod · 0.80

Tested by

no test coverage detected