Unverified Commit 0d4e4e90 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Fix add-entry span duration (#29288)



Currently the span is finished on seal but that's not the actual timing where the entry span is finished as there's a `succeedEntry` hook. This PR changes the span to finish on `succeedEntry`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
parent ead56eaa
......@@ -179,19 +179,19 @@ export class ProfilingPlugin {
{ parentSpan: () => spans.get(compilation)! }
)
this.traceHookPair(
'add-entry',
compilation.hooks.addEntry,
compilation.hooks.afterSeal,
{
attrs: (entry: any) => {
return {
request: entry.request,
}
},
parentSpan: () => spans.get(compilation)!,
compilation.hooks.addEntry.tap(pluginName, (entry: any) => {
const compilationSpan = spans.get(compilation)
if (!compilationSpan) {
return
}
)
const addEntrySpan = compilationSpan.traceChild('add-entry')
addEntrySpan.setAttribute('request', entry.request)
spans.set(entry, addEntrySpan)
})
compilation.hooks.succeedEntry.tap(pluginName, (entry: any) => {
spans.get(entry)?.stop()
})
}
this.traceHookPair(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment