Skip to content

Commit 82c32ee

Browse files
committed
WIP
1 parent 9c918e9 commit 82c32ee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/instrumentation.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
console.log(`process uptime: ${Math.round(process.uptime() * 1000)}ms`);
22
console.time('startup');
33
console.time('instrumentation');
4+
console.time('imports instrumentation');
45
import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api';
56
import {
67
BatchSpanProcessor,
78
SimpleSpanProcessor,
89
} from '@opentelemetry/sdk-trace-base';
910
import * as Sentry from '@sentry/node';
11+
console.timeEnd('imports instrumentation');
1012

13+
console.time('instrumentation setup');
1114
if (process.env.NODE_ENV === 'production') {
1215
if (process.env.OTEL_DEBUG_LOGGING) {
1316
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
1417
} else {
1518
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
1619
}
1720
}
21+
console.timeEnd('instrumentation setup');
1822

23+
console.time('sentry instrumentation');
1924
if (process.env.SENTRY_DSN) {
2025
const sentryClient = Sentry.init({
2126
dsn: process.env.SENTRY_DSN,
@@ -47,6 +52,7 @@ if (process.env.SENTRY_DSN) {
4752
);
4853
}
4954
}
55+
console.timeEnd('sentry instrumentation');
5056

5157
export function spanWrapper<TArgs extends unknown[], TReturn>(
5258
fn: (...args: TArgs) => TReturn,

0 commit comments

Comments
 (0)