Skip to content

Commit 58ba0e0

Browse files
committed
Enable tracesSampleRate and wire web vitals into Sentry main loop
`tracesSampleRate: 1.0` — CI benchmark runs must capture every span. Without this, `Sentry.startSpan` calls in `sendWebVitalsToSentry` would be sampled out. Only affects this CI-only script, not the extension. Calls `sendWebVitalsToSentry` for each benchmark that has `webVitals` data, keeping it separate from the existing timer structured log on the line above. Timer reporting is unchanged. Uses `@sentry/node` v10 (devDependency, added by #38876). Isolated from `@sentry/browser` v8 in the extension runtime — different processes, different `@sentry/core` resolutions in `yarn.lock`.
1 parent 4d9d970 commit 58ba0e0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/e2e/benchmarks/send-to-sentry.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ async function main() {
157157
Sentry.init({
158158
dsn: SENTRY_DSN,
159159
enableLogs: true,
160+
tracesSampleRate: 1.0, // CI benchmarks: capture all spans
160161
release: `metamask-extension@${version}`,
161162
});
162163

@@ -180,12 +181,24 @@ async function main() {
180181
...mapKeys(benchmark.p95, (_, key) => `benchmark.p95.${key}`),
181182
};
182183

184+
// Timer data: structured logs (existing path, unchanged)
183185
Sentry.logger.info(`benchmark.${name}`, {
184186
...baseCiAttributes,
185187
'ci.persona': benchmark.persona || 'standard',
186188
'ci.testTitle': benchmark.testTitle,
187189
...benchmarkAttributes,
188190
});
191+
192+
// Web vitals: separate reporting path via spans
193+
if (benchmark.webVitals) {
194+
sendWebVitalsToSentry(
195+
name,
196+
benchmark.webVitals,
197+
benchmark.persona || 'standard',
198+
benchmark.testTitle,
199+
baseCiAttributes,
200+
);
201+
}
189202
} else {
190203
// User action result with numeric timing metrics
191204
const metrics = Object.entries(value).reduce(

0 commit comments

Comments
 (0)