Skip to content

Commit 68bec6a

Browse files
author
Luca Forstner
authored
ref(core): Send project as dist in telemetry (#148)
1 parent 3423a0a commit 68bec6a

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

packages/bundler-plugin-core/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ const unplugin = createUnplugin<Options>((options, unpluginMetaContext) => {
6464

6565
const { sentryHub, sentryClient } = makeSentryClient(
6666
"https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
67-
allowedToSendTelemetryPromise
67+
allowedToSendTelemetryPromise,
68+
internalOptions.project
6869
);
6970

7071
addPluginOptionInformationToHub(internalOptions, sentryHub, unpluginMetaContext.framework);

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ const SENTRY_SAAS_HOSTNAME = "sentry.io";
77

88
export function makeSentryClient(
99
dsn: string,
10-
allowedToSendTelemetryPromise: Promise<boolean>
10+
allowedToSendTelemetryPromise: Promise<boolean>,
11+
userProject: string | undefined
1112
): { sentryHub: Hub; sentryClient: NodeClient } {
1213
const client = new NodeClient({
1314
dsn,
1415

1516
tracesSampleRate: 1,
1617
sampleRate: 1,
1718

19+
// We're also sending the user project in dist because it is an indexed fieldso we can use this data effectively in
20+
// a dashboard.
21+
// Yes, this is slightly abusing the purpose of this field.
22+
dist: userProject,
23+
1824
release: __PACKAGE_VERSION__,
1925
integrations: [],
2026
tracePropagationTargets: ["sentry.io/api"],

0 commit comments

Comments
 (0)