Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion packages/node/src/sdk/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export class NodeClient extends ServerRuntimeClient<NodeClientOptions> {
private _logOnExitFlushListener: (() => void) | undefined;

public constructor(options: NodeClientOptions) {
const serverName = options.serverName || global.process.env.SENTRY_NAME || os.hostname();
const serverName = options.skipIncludingServerName
? undefined
: options.serverName || global.process.env.SENTRY_NAME || os.hostname();

const clientOptions: ServerRuntimeClientOptions = {
...options,
platform: 'node',
Expand Down
8 changes: 8 additions & 0 deletions packages/node/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ export interface BaseNodeOptions {
*/
profileLifecycle?: 'manual' | 'trace';

/**
* If set to true, the SDK will not automatically detect the `serverName`.
*
* This is useful if you are using the SDK in a CLI app or Electron where the
* hostname might be considered PII.
*/
skipIncludingServerName?: boolean;

/** Sets an optional server name (device name) */
serverName?: string;

Expand Down
Loading