Skip to content

Commit a0cdf5f

Browse files
committed
Apply sdk name as sentry.javascript.node-light (with npm package
@sentry/node-core)
1 parent 4bf9b15 commit a0cdf5f

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

packages/node-core/src/light/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class LightNodeClient extends ServerRuntimeClient<NodeClientOptions> {
2626
serverName,
2727
};
2828

29-
applySdkMetadata(clientOptions, 'node');
29+
applySdkMetadata(clientOptions, 'node-light', ['node-core']);
3030

3131
debug.log(`Initializing Sentry: process: ${process.pid}, thread: ${isMainThread ? 'main' : `worker-${threadId}`}.`);
3232

packages/node-core/src/light/sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function _init(
121121
);
122122
}
123123

124-
applySdkMetadata(options, 'node-core', ['node-core-light']);
124+
applySdkMetadata(options, 'node-light', ['node-core']);
125125

126126
const client = new LightNodeClient(options);
127127
// The client is on the current scope, from where it generally is inherited

packages/node-core/test/light/sdk.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ describe('Light Mode | SDK', () => {
1515
expect(client).toBeInstanceOf(LightNodeClient);
1616
});
1717

18+
it('sets correct SDK metadata', () => {
19+
const client = mockLightSdkInit();
20+
21+
const metadata = client?.getOptions()._metadata;
22+
expect(metadata?.sdk?.name).toBe('sentry.javascript.node-light');
23+
expect(metadata?.sdk?.packages).toEqual([
24+
{
25+
name: 'npm:@sentry/node-core',
26+
version: expect.any(String),
27+
},
28+
]);
29+
});
30+
1831
it('sets the client on the current scope', () => {
1932
const client = mockLightSdkInit();
2033

0 commit comments

Comments
 (0)