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