Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version in trace #30982

Merged
merged 2 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/server/dev/hot-reloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion packages/next/trace/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}

Expand Down
13 changes: 8 additions & 5 deletions scripts/send-trace-to-jaeger.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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, '')
})
Expand Down