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

Telemetry-compatible tracing #22713

Merged
merged 16 commits into from
Mar 10, 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
39 changes: 0 additions & 39 deletions bench/instrument.js

This file was deleted.

7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
"publish-stable": "lerna version --force-publish",
"lint-staged": "lint-staged",
"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"
},
"pre-commit": "lint-staged",
Expand All @@ -45,11 +43,6 @@
"@babel/preset-react": "7.12.10",
"@fullhuman/postcss-purgecss": "1.3.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",
"@types/cheerio": "0.22.16",
"@types/fs-extra": "8.1.0",
Expand Down
14 changes: 1 addition & 13 deletions packages/next/bin/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import * as log from '../build/output/log'
import arg from 'next/dist/compiled/arg/index.js'
import { NON_STANDARD_NODE_ENV } from '../lib/constants'
import opentelemetryApi from '@opentelemetry/api'
;['react', 'react-dom'].forEach((dependency) => {
try {
// When 'npm link' is used it checks the clone location. Not the project.
Expand Down Expand Up @@ -107,18 +106,7 @@ if (typeof React.Suspense === 'undefined') {
process.on('SIGTERM', () => process.exit(0))
process.on('SIGINT', () => process.exit(0))

commands[command]()
.then((exec) => exec(forwardedArgs))
.then(async () => {
if (command === 'build') {
// @ts-ignore getDelegate exists
const tp = opentelemetryApi.trace.getTracerProvider().getDelegate()
if (tp.shutdown) {
await tp.shutdown()
}
process.exit(0)
}
})
commands[command]().then((exec) => exec(forwardedArgs))

if (command === 'dev') {
const { CONFIG_FILE } = require('../next-server/lib/constants')
Expand Down
Loading