Skip to content

Commit 06f47c3

Browse files
timfishandreiborza
authored andcommitted
feat(node): Log process and thread info on initialisation (#11972)
1 parent a829c3e commit 06f47c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/node/src/sdk/client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { trace } from '@opentelemetry/api';
44
import type { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';
55
import type { ServerRuntimeClientOptions } from '@sentry/core';
66
import { SDK_VERSION, ServerRuntimeClient, applySdkMetadata } from '@sentry/core';
7+
import { logger } from '@sentry/utils';
8+
import { isMainThread, threadId } from 'worker_threads';
79
import type { NodeClientOptions } from '../types';
810

911
/** A client for using Sentry with Node & OpenTelemetry. */
@@ -21,6 +23,10 @@ export class NodeClient extends ServerRuntimeClient<NodeClientOptions> {
2123

2224
applySdkMetadata(clientOptions, 'node');
2325

26+
logger.log(
27+
`Initializing Sentry: process: ${process.pid}, thread: ${isMainThread ? 'main' : `worker-${threadId}`}.`,
28+
);
29+
2430
super(clientOptions);
2531
}
2632

0 commit comments

Comments
 (0)