12345678910111213141516171819202122232425262728293031323334353637 |
- import * as os from 'os';
- import { TextEncoder } from 'util';
- import { ServerRuntimeClient, applySdkMetadata } from '@sentry/core';
- class NodeClient extends ServerRuntimeClient {
-
- constructor(options) {
- applySdkMetadata(options, 'node');
-
- options.transportOptions = {
- textEncoder: new TextEncoder(),
- ...options.transportOptions,
- };
- const clientOptions = {
- ...options,
- platform: 'node',
- runtime: { name: 'node', version: global.process.version },
- serverName: options.serverName || global.process.env.SENTRY_NAME || os.hostname(),
- };
- super(clientOptions);
- }
- }
- export { NodeClient };
|