Skip to content

Commit 174c33a

Browse files
authored
feat(core): Add node version tag (#118)
Add another tag to Sentry events containing the used node version. This can help us with seeing in which node versions the plugins (and possibly their respective projects) are used.
1 parent 2e0abd0 commit 174c33a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/bundler-plugin-core/src/sentry/telemetry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,6 @@ export function addPluginOptionTags(options: InternalOptions, hub: Hub) {
116116
if (errorHandler) {
117117
hub.setTag("error-handler", "custom");
118118
}
119+
120+
hub.setTag("node", process.version);
119121
}

packages/bundler-plugin-core/test/sentry/telemetry.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ describe("addPluginOptionTags", () => {
135135

136136
it("shouldn't set any tags other than include if no opional options are specified", () => {
137137
addPluginOptionTags(defaultOptions as unknown as InternalOptions, mockedHub as unknown as Hub);
138-
expect(mockedHub.setTag).toHaveBeenCalledTimes(1);
138+
expect(mockedHub.setTag).toHaveBeenCalledTimes(2);
139139
expect(mockedHub.setTag).toHaveBeenCalledWith("include", "single-entry");
140+
expect(mockedHub.setTag).toHaveBeenCalledWith("node", expect.any(String));
140141
});
141142
});

0 commit comments

Comments
 (0)