Skip to content

Commit 21a1c9a

Browse files
committed
ref: Update collected telemetry
1 parent 9bb19f3 commit 21a1c9a

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

packages/bundler-plugin-core/src/debug-id-upload.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { Logger } from "./sentry/logger";
77
import { promisify } from "util";
88
import { Hub, NodeClient } from "@sentry/node";
99
import SentryCli from "@sentry/cli";
10-
import { dynamicSamplingContextToSentryBaggageHeader } from "@sentry/utils";
1110
import { safeFlushTelemetry } from "./sentry/telemetry";
1211

1312
interface RewriteSourcesHook {
@@ -152,14 +151,7 @@ export function createDebugIdUploadFunction({
152151

153152
const cliInstance = new SentryCli(null, {
154153
...sentryCliOptions,
155-
headers: {
156-
"sentry-trace": uploadSpan.toTraceparent(),
157-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
158-
baggage: dynamicSamplingContextToSentryBaggageHeader(
159-
artifactBundleUploadTransaction.getDynamicSamplingContext()
160-
)!,
161-
...sentryCliOptions.headers,
162-
},
154+
headers: sentryCliOptions.headers,
163155
});
164156

165157
await cliInstance.releases.uploadSourceMaps(

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

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import SentryCli from "@sentry/cli";
22
import { defaultStackParser, Hub, makeNodeTransport, NodeClient } from "@sentry/node";
33
import { NormalizedOptions, SENTRY_SAAS_URL } from "../options-mapping";
4+
import crypto from "crypto";
45

56
const SENTRY_SAAS_HOSTNAME = "sentry.io";
67

@@ -99,13 +100,15 @@ export function setTelemetryDataOnHub(options: NormalizedOptions, hub: Hub, bund
99100

100101
hub.setTag("application-key-set", options.applicationKey !== undefined);
101102

102-
hub.setTags({
103-
organization: org,
104-
project,
105-
bundler,
106-
});
103+
hub.setTag("bundler", bundler);
107104

108-
hub.setUser({ id: org });
105+
if (org) {
106+
hub.setTag("org-hash", crypto.createHash("md5").update(org).digest("hex"));
107+
}
108+
109+
if (project) {
110+
hub.setTag("project-hash", crypto.createHash("md5").update(project).digest("hex"));
111+
}
109112
}
110113

111114
export async function allowedToSendTelemetry(options: NormalizedOptions): Promise<boolean> {

0 commit comments

Comments
 (0)