Telemetry-compatible tracing (#22713)
A number of changes here. I recommend viewing the diff with the <a href="?w=1">whitespace flag enabled</a>. - OpenTelemetry is replaced with a custom and lightweight tracing solution. - Three trace targets are currently supported: console, Zipkin, and NextJS. - Tracing is now governed by environment variables rather than `--require instrument.js`. + `TRACE_TARGET`: one of `CONSOLE`, `ZIPKIN`, or `TELEMETRY`; defaults to `TELEMETRY` if unset or invalid. + `TRACE_ID`: an 8-byte hex-encoded value used as the Zipkin trace ID; if not provided, this value will be randomly generated and passed down to subprocesses. Other sundry: - I'm missing something, probably a setup step, with the Zipkin target. Traces are captured successfully, but you have to manually enter the Trace ID in order to view the trace - it doesn't show up in queries. - I'm generally unhappy with [this commit](https://github.com/vercel/next.js/pull/22713/commits/235cedcb3ead76b630b4c8aa695f904489da2831). It is... untidy to provide a telemetry object via `setGlobal`, but I don't have a ready alternative. Is `distDir` strictly required when creating a new Telemetry object? I didn't dig too deep here. As noted, there are a lot of changes, so it'd be great if a reviewer could: - [ ] pull down the branch and try to break it - [ ] check the Zipkin traces and identify possible regressions in the functionality Closes #22570 Fixes #22574
Showing
bench/instrument.js
deleted
100644 → 0
| ... | @@ -34,8 +34,6 @@ | ... | @@ -34,8 +34,6 @@ |
| "publish-stable": "lerna version --force-publish", | "publish-stable": "lerna version --force-publish", | ||
| "lint-staged": "lint-staged", | "lint-staged": "lint-staged", | ||
| "next": "node --trace-deprecation packages/next/dist/bin/next", | "next": "node --trace-deprecation packages/next/dist/bin/next", | ||
| "trace": "node --trace-deprecation -r ./bench/instrument.js packages/next/dist/bin/next", | |||
| "trace-debug": "node --inspect --trace-deprecation -r ./bench/instrument.js packages/next/dist/bin/next", | |||
| "debug": "node --inspect packages/next/dist/bin/next" | "debug": "node --inspect packages/next/dist/bin/next" | ||
| }, | }, | ||
| "pre-commit": "lint-staged", | "pre-commit": "lint-staged", | ||
| ... | @@ -45,11 +43,6 @@ | ... | @@ -45,11 +43,6 @@ |
| "@babel/preset-react": "7.12.10", | "@babel/preset-react": "7.12.10", | ||
| "@fullhuman/postcss-purgecss": "1.3.0", | "@fullhuman/postcss-purgecss": "1.3.0", | ||
| "@mdx-js/loader": "0.18.0", | "@mdx-js/loader": "0.18.0", | ||
| "@opentelemetry/exporter-zipkin": "0.14.0", | |||
| "@opentelemetry/node": "0.14.0", | |||
| "@opentelemetry/plugin-http": "0.14.0", | |||
| "@opentelemetry/plugin-https": "0.14.0", | |||
| "@opentelemetry/tracing": "0.14.0", | |||
| "@testing-library/react": "11.2.5", | "@testing-library/react": "11.2.5", | ||
| "@types/cheerio": "0.22.16", | "@types/cheerio": "0.22.16", | ||
| "@types/fs-extra": "8.1.0", | "@types/fs-extra": "8.1.0", | ||
| ... | ... |
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment