From 51dbe411c99ad557ade6416f01365f07045c36a6 Mon Sep 17 00:00:00 2001 From: Cristen Jones Date: Mon, 29 Jun 2026 18:28:08 -0400 Subject: [PATCH 1/3] deps(npm): remove `@sentry/node` --- package-lock.json | 59 ----------------------------------------------- package.json | 1 - 2 files changed, 60 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6740d9795b..aec1d4793f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,6 @@ "hasInstallScript": true, "dependencies": { "@playwright/test": "1.58.1", - "@sentry/node": "7.109.0", "artillery": "2.0.30", "axios": "1.16.0", "csv-parse": "^6.1.0", @@ -4192,64 +4191,6 @@ "@redis/client": "^1.0.0" } }, - "node_modules/@sentry-internal/tracing": { - "version": "7.109.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.109.0.tgz", - "integrity": "sha512-PzK/joC5tCuh2R/PRh+7dp+uuZl7pTsBIjPhVZHMTtb9+ls65WkdZJ1/uKXPouyz8NOo9Xok7aEvEo9seongyw==", - "dependencies": { - "@sentry/core": "7.109.0", - "@sentry/types": "7.109.0", - "@sentry/utils": "7.109.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/core": { - "version": "7.109.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.109.0.tgz", - "integrity": "sha512-xwD4U0IlvvlE/x/g/W1I8b4Cfb16SsCMmiEuBf6XxvAa3OfWBxKoqLifb3GyrbxMC4LbIIZCN/SvLlnGJPgszA==", - "dependencies": { - "@sentry/types": "7.109.0", - "@sentry/utils": "7.109.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/node": { - "version": "7.109.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.109.0.tgz", - "integrity": "sha512-tqMNAES4X/iBl1eZRCmc29p//0id01FBLEiesNo5nk6ECl6/SaGMFAEwu1gsn90h/Bjgr04slwFOS4cR45V2PQ==", - "dependencies": { - "@sentry-internal/tracing": "7.109.0", - "@sentry/core": "7.109.0", - "@sentry/types": "7.109.0", - "@sentry/utils": "7.109.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/types": { - "version": "7.109.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.109.0.tgz", - "integrity": "sha512-egCBnDv3YpVFoNzRLdP0soVrxVLCQ+rovREKJ1sw3rA2/MFH9WJ+DZZexsX89yeAFzy1IFsCp7/dEqudusml6g==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/utils": { - "version": "7.109.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.109.0.tgz", - "integrity": "sha512-3RjxMOLMBwZ5VSiH84+o/3NY2An4Zldjz0EbfEQNRY9yffRiCPJSQiCJID8EoylCFOh/PAhPimBhqbtWJxX6iw==", - "dependencies": { - "@sentry/types": "7.109.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@sideway/address": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", diff --git a/package.json b/package.json index 98d923f4c8..01944d8a19 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "dotcom", "dependencies": { "@playwright/test": "1.58.1", - "@sentry/node": "7.109.0", "artillery": "2.0.30", "axios": "1.16.0", "csv-parse": "^6.1.0", From 8f3f814dcfcb9bb53d65ee3fcff02710ba3a4172 Mon Sep 17 00:00:00 2001 From: Cristen Jones Date: Mon, 29 Jun 2026 18:28:41 -0400 Subject: [PATCH 2/3] chore: remove RateLimiter script --- integration/monitor/rate-limiter.js | 35 ------------------- .../tests/monitor/rate-limiter.test.cjs | 23 ------------ 2 files changed, 58 deletions(-) delete mode 100644 integration/monitor/rate-limiter.js delete mode 100644 integration/tests/monitor/rate-limiter.test.cjs diff --git a/integration/monitor/rate-limiter.js b/integration/monitor/rate-limiter.js deleted file mode 100644 index 5be6b7c3d2..0000000000 --- a/integration/monitor/rate-limiter.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * A simple rate limiter that allows a limited number of leases in a window of time. - * @constructor - * @param {number} window - The window of time in milliseconds in which to count leases. - * @param {number} limit - The maximum number of leases in the window. Default 1. - */ -class RateLimiter { - - constructor(window, limit = 1) { - this.window = window; - this.limit = limit; - - this.leases = 0; - - setInterval(() => { - this.leases = 0; - }, window); - } - - /** - * Attempt to acquire a lease. Returns true if a lease was acquired, false otherwise. - * @returns {boolean} - */ - lease() { - if (this.leases < this.limit) { - this.leases += 1; - return true; - } else { - return false; - } - } - -} - -module.exports = RateLimiter; diff --git a/integration/tests/monitor/rate-limiter.test.cjs b/integration/tests/monitor/rate-limiter.test.cjs deleted file mode 100644 index 6afe2037ec..0000000000 --- a/integration/tests/monitor/rate-limiter.test.cjs +++ /dev/null @@ -1,23 +0,0 @@ -const assert = require('node:assert/strict'); -const { describe, it } = require("node:test"); - -const RateLimiter = require("../../monitor/rate-limiter"); - -describe("lease()", () => { - it("rejects a lease within the window", () => { - const rateLimiter = new RateLimiter(1000, 1); - - assert.equal(rateLimiter.lease(), true); - assert.equal(rateLimiter.lease(), false); - }); - - it("accepts a lease after the window", () => { - const rateLimiter = new RateLimiter(1000, 1); - - assert.equal(rateLimiter.lease(), true); - - setTimeout(() => { - assert.equal(rateLimiter.lease(), true); - }, 1000); - }); -}); From 803085982f061468543977590f52f3ead24e1d43 Mon Sep 17 00:00:00 2001 From: Cristen Jones Date: Mon, 29 Jun 2026 18:32:42 -0400 Subject: [PATCH 3/3] chore(monitor): stop sending test fail screenshots They haven't been terribly enlightening so far, and so I'd like to stop wasting our Sentry quota/rate limit on it. --- integration/monitor/all-scenarios.js | 38 +--------------------------- integration/monitor/worker.js | 7 ++--- 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/integration/monitor/all-scenarios.js b/integration/monitor/all-scenarios.js index f23a29515f..b36244d3b0 100644 --- a/integration/monitor/all-scenarios.js +++ b/integration/monitor/all-scenarios.js @@ -2,56 +2,20 @@ const cron = require("node-cron"); const { exec } = require("child_process"); const fs = require("fs"); const path = require("path"); -const Sentry = require("@sentry/node"); const { Worker } = require("worker_threads"); const { fileToMetricName } = require("../utils"); -const RateLimiter = require("./rate-limiter"); const filesPath = path.join(__dirname, "..", "scenarios"); -/* - * Create a rate limiter that allows only one lease per hour. - */ -const rateLimiter = new RateLimiter(60 * 60 * 1000, 1); - -/* - * Initialize Sentry with the DSN and environment from the environment variables. - * Add a beforeSend callback that will only send events if the rate limiter allows it. - */ -Sentry.init({ - dsn: process.env.SENTRY_DSN, - environment: process.env.SENTRY_ENVIRONMENT, - beforeSend(event) { - if (process.env.SENTRY_ENVIRONMENT == "prod") { - return rateLimiter.lease() ? event : null; - } - - return null; - } -}); - /* * Create a worker for each scenario file in the scenarios directory. */ const workers = fs.readdirSync(filesPath).map((file) => { const name = fileToMetricName(file); - const worker = new Worker(path.join(__dirname, "worker.js"), { + return new Worker(path.join(__dirname, "worker.js"), { workerData: { name, path: path.join(filesPath, file) }, }); - - worker.on("message", ({ exception, metric, screenshot }) => { - Sentry.getCurrentScope().addAttachment({ - filename: `${metric}-${Date.now()}.jpeg`, - data: screenshot, - }); - - Sentry.captureException(exception); - - Sentry.getCurrentScope().clearAttachments(); - }); - - return worker; }); /* diff --git a/integration/monitor/worker.js b/integration/monitor/worker.js index 48ce78f7f0..3f5c9f8adb 100644 --- a/integration/monitor/worker.js +++ b/integration/monitor/worker.js @@ -18,17 +18,14 @@ const metric = `${prefix}${workerData.name}`; parentPort.on("message", async (_) => { const browser = await chromium.launch(); - const context = await browser.newContext({ userAgent: 'Playwright' }); + const context = await browser.newContext({ userAgent: "Playwright" }); const page = await context.newPage(); const start = performance.now(); try { await scenario({ page, baseURL }); - } catch(exception) { - const screenshot = await page.screenshot({quality: 50, type: "jpeg"}); - - parentPort.postMessage({exception, metric, screenshot}); + } catch (exception) { logger.error({ metric, error: exception.message }); }