Skip to content

Commit 45c7f1c

Browse files
authored
feat: Allow passing of meta-framework as telemetry data (#539)
1 parent f22747b commit 45c7f1c

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

Diff for: packages/bundler-plugin-core/src/options-mapping.ts

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export function normalizeUserOptions(userOptions: UserOptions) {
2929
},
3030
bundleSizeOptimizations: userOptions.bundleSizeOptimizations,
3131
reactComponentAnnotation: userOptions.reactComponentAnnotation,
32+
_metaOptions: {
33+
telemetry: {
34+
metaFramework: userOptions._metaOptions?.telemetry?.metaFramework,
35+
},
36+
},
3237
moduleMetadata: userOptions.moduleMetadata || userOptions._experiments?.moduleMetadata,
3338
_experiments: userOptions._experiments ?? {},
3439
};

Diff for: packages/bundler-plugin-core/src/sentry/telemetry.ts

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ export function setTelemetryDataOnHub(options: NormalizedOptions, hub: Hub, bund
9595
hub.setTag("node", process.version);
9696
hub.setTag("platform", process.platform);
9797

98+
hub.setTag("meta-framework", options._metaOptions.telemetry.metaFramework ?? "none");
99+
98100
hub.setTags({
99101
organization: org,
100102
project,

Diff for: packages/bundler-plugin-core/src/types.ts

+10
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,16 @@ export interface Options {
358358
* Example value: `[sentry-webpack-plugin (client)]`
359359
*/
360360
loggerPrefixOverride?: string;
361+
362+
/**
363+
* Arbitrary telemetry items.
364+
*/
365+
telemetry?: {
366+
/**
367+
* The meta framework using the plugin.
368+
*/
369+
metaFramework?: string;
370+
};
361371
};
362372
}
363373

Diff for: packages/bundler-plugin-core/test/option-mappings.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ describe("normalizeUserOptions()", () => {
2727
silent: false,
2828
telemetry: true,
2929
_experiments: {},
30+
_metaOptions: {
31+
telemetry: {
32+
metaFramework: undefined,
33+
},
34+
},
3035
url: "https://sentry.io",
3136
});
3237
});
@@ -73,6 +78,11 @@ describe("normalizeUserOptions()", () => {
7378
silent: false,
7479
telemetry: true,
7580
_experiments: {},
81+
_metaOptions: {
82+
telemetry: {
83+
metaFramework: undefined,
84+
},
85+
},
7686
url: "https://sentry.io",
7787
});
7888
});

0 commit comments

Comments
 (0)