Skip to content

Commit

Permalink
Add module type to build-module trace (#28128)
Browse files Browse the repository at this point in the history
Add `-js` `-ts` `-tsx` `-css` to `build-module` in traces to allow for easier filtering. 

## 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
  • Loading branch information
timneutkens committed Aug 16, 2021
1 parent 24b09ad commit f28b965
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/next/build/webpack/plugins/profiling-plugin.ts
Expand Up @@ -99,7 +99,18 @@ export class ProfilingPlugin {
return
}

const span = trace('build-module', compilerSpan.id)
const moduleType = (() => {
if (!module.userRequest) {
return ''
}

return module.userRequest.split('.').pop()
})()

const span = trace(
`build-module${moduleType ? `-${moduleType}` : ''}`,
compilerSpan.id
)
span.setAttribute('name', module.userRequest)
spans.set(module, span)
})
Expand Down

0 comments on commit f28b965

Please sign in to comment.