Skip to content

Commit

Permalink
Update profiling approach to cover webpack runs (#20900)
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Jan 10, 2021
1 parent 8bdff57 commit 90ad2cb
Show file tree
Hide file tree
Showing 12 changed files with 2,112 additions and 2,157 deletions.
30 changes: 27 additions & 3 deletions bench/instrument.js
@@ -1,11 +1,35 @@
// Disable automatic instrumentation
process.env.OTEL_NO_PATCH_MODULES = '*'

const { NodeTracerProvider } = require('@opentelemetry/node')
const { BatchSpanProcessor } = require('@opentelemetry/tracing')
const { SimpleSpanProcessor } = require('@opentelemetry/tracing')
const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin')

const tracerProvider = new NodeTracerProvider()
const tracerProvider = new NodeTracerProvider({
// All automatic instrumentation plugins have to be disabled as it affects worker_thread/child_process bootup performance
plugins: {
mongodb: { enabled: false, path: '@opentelemetry/plugin-mongodb' },
grpc: { enabled: false, path: '@opentelemetry/plugin-grpc' },
'@grpc/grpc-js': { enabled: false, path: '@opentelemetry/plugin-grpc-js' },
http: { enabled: false, path: '@opentelemetry/plugin-http' },
https: { enabled: false, path: '@opentelemetry/plugin-https' },
mysql: { enabled: false, path: '@opentelemetry/plugin-mysql' },
pg: { enabled: false, path: '@opentelemetry/plugin-pg' },
redis: { enabled: false, path: '@opentelemetry/plugin-redis' },
ioredis: { enabled: false, path: '@opentelemetry/plugin-ioredis' },
'pg-pool': { enabled: false, path: '@opentelemetry/plugin-pg-pool' },
express: { enabled: false, path: '@opentelemetry/plugin-express' },
'@hapi/hapi': {
enabled: false,
path: '@opentelemetry/hapi-instrumentation',
},
koa: { enabled: false, path: '@opentelemetry/koa-instrumentation' },
dns: { enabled: false, path: '@opentelemetry/plugin-dns' },
},
})

tracerProvider.addSpanProcessor(
new BatchSpanProcessor(
new SimpleSpanProcessor(
new ZipkinExporter({
serviceName: 'next-js',
})
Expand Down

0 comments on commit 90ad2cb

Please sign in to comment.