Unverified Commit ad6b9c2d authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Fix version in trace (#30982)

Noticed the trace can't be imported because the tags are a nested as apparently the type was not restrictive of that.


## 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 by running `yarn lint`
parent b408d733
......@@ -133,7 +133,7 @@ export default async function build(
runLint = true
): Promise<void> {
const nextBuildSpan = trace('next-build', undefined, {
attrs: { version: process.env.__NEXT_VERSION },
version: process.env.__NEXT_VERSION as string,
})
const buildResult = await nextBuildSpan.traceAsyncFn(async () => {
......
......@@ -192,7 +192,7 @@ export default class HotReloader {
this.previewProps = previewProps
this.rewrites = rewrites
this.hotReloaderSpan = trace('hot-reloader', undefined, {
attrs: { version: process.env.__NEXT_VERSION },
version: process.env.__NEXT_VERSION as string,
})
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
// of the current `next dev` invocation.
......
......@@ -100,7 +100,11 @@ export class Span {
}
}
export const trace = (name: string, parentId?: SpanId, attrs?: Object) => {
export const trace = (
name: string,
parentId?: SpanId,
attrs?: { [key: string]: string }
) => {
return new Span({ name, parentId, attrs })
}
......
......@@ -49,11 +49,14 @@ file.pipe(eventStream.split()).pipe(
)
.then(async (res) => {
if (res.status !== 202) {
console.log({
status: res.status,
body: await res.text(),
events: eventsJson,
})
console.dir(
{
status: res.status,
body: await res.text(),
events: eventsJson,
},
{ depth: null }
)
}
cb(null, '')
})
......
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