From b3b3dab8d0bb196c56f5c418d277b489275ed615 Mon Sep 17 00:00:00 2001 From: John Hobbs Date: Tue, 10 Sep 2024 14:46:04 -0500 Subject: [PATCH 1/6] Add Sentry package --- package.json | 1 + yarn.lock | 713 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 712 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 063659b71..91b7a168a 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "@auto-it/slack": "^11.1.6", "@discoveryjs/json-ext": "^0.5.7", "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0", + "@sentry/node": "^8.30.0", "@storybook/addon-essentials": "^8.1.5", "@storybook/addon-webpack5-compiler-swc": "^1.0.3", "@storybook/csf-tools": "^8.1.5", diff --git a/yarn.lock b/yarn.lock index 29e9038b5..94dd1ccce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2740,6 +2740,388 @@ __metadata: languageName: node linkType: hard +"@opentelemetry/api-logs@npm:0.52.1": + version: 0.52.1 + resolution: "@opentelemetry/api-logs@npm:0.52.1" + dependencies: + "@opentelemetry/api": "npm:^1.0.0" + checksum: 10c0/fddecb2211f987bf1a7f104594e58227655c887a6a22b41e9ead5ed925a4594b56186b38fca8e24db33058a924d8b54ddd6b315eca915c469f9653ce7813c31a + languageName: node + linkType: hard + +"@opentelemetry/api-logs@npm:0.53.0": + version: 0.53.0 + resolution: "@opentelemetry/api-logs@npm:0.53.0" + dependencies: + "@opentelemetry/api": "npm:^1.0.0" + checksum: 10c0/969ad3bbb74e3de6fdfe8eb9b3ab86d3dc284ca7bffd0ca67eef64efd08c97a4305696afe0b7b03e5d356f15d0a1a67ac517e5fa7d1ddee6fdc249eef2209fcb + languageName: node + linkType: hard + +"@opentelemetry/api@npm:^1.0.0, @opentelemetry/api@npm:^1.8, @opentelemetry/api@npm:^1.9.0": + version: 1.9.0 + resolution: "@opentelemetry/api@npm:1.9.0" + checksum: 10c0/9aae2fe6e8a3a3eeb6c1fdef78e1939cf05a0f37f8a4fae4d6bf2e09eb1e06f966ece85805626e01ba5fab48072b94f19b835449e58b6d26720ee19a58298add + languageName: node + linkType: hard + +"@opentelemetry/context-async-hooks@npm:^1.25.1": + version: 1.26.0 + resolution: "@opentelemetry/context-async-hooks@npm:1.26.0" + peerDependencies: + "@opentelemetry/api": ">=1.0.0 <1.10.0" + checksum: 10c0/76ed53be50a472cbfe26a62620cb2a34f031474d08d302d31eb95d71cac2ed1567c6fa302c7ac5498e9d467d7d8e64f8d0e58c5c8b7bd987a352baafe5d9b213 + languageName: node + linkType: hard + +"@opentelemetry/core@npm:1.26.0, @opentelemetry/core@npm:^1.1.0, @opentelemetry/core@npm:^1.25.1, @opentelemetry/core@npm:^1.8.0": + version: 1.26.0 + resolution: "@opentelemetry/core@npm:1.26.0" + dependencies: + "@opentelemetry/semantic-conventions": "npm:1.27.0" + peerDependencies: + "@opentelemetry/api": ">=1.0.0 <1.10.0" + checksum: 10c0/8038a3b9124a0b3b48dceb3949f88726c6853eac33b79fc049856f78dcf4b7ee453db1e6f4d5205a79b315caba809cb7d2f853946cf14773e50ce6a87fd5260e + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-connect@npm:0.39.0": + version: 0.39.0 + resolution: "@opentelemetry/instrumentation-connect@npm:0.39.0" + dependencies: + "@opentelemetry/core": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@types/connect": "npm:3.4.36" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/c137f64b32d2bf916c0e928428ece7313682c9e845052d1f3884e807dcc0417c7751577e04451200c8d49448789c197f459dbbaad3ccb3748342cdfd242b3b51 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-express@npm:0.42.0": + version: 0.42.0 + resolution: "@opentelemetry/instrumentation-express@npm:0.42.0" + dependencies: + "@opentelemetry/core": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/ba0749ba7e74898a1cb361fdef65661eb84218d827d3e53ab5b4fa46a2e5a35b944e64bb5f5391ead0e0578f94a7624d953b06b66de0467a64d43bcf24d20f3c + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-fastify@npm:0.39.0": + version: 0.39.0 + resolution: "@opentelemetry/instrumentation-fastify@npm:0.39.0" + dependencies: + "@opentelemetry/core": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/2363868111029b2c874f64c31fe41232b21922dfba62892e422cab8af19f0d2995807afba7112c570d93a2a8634e3ad79ea4171f010ecd869439cf863967f939 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-fs@npm:0.15.0": + version: 0.15.0 + resolution: "@opentelemetry/instrumentation-fs@npm:0.15.0" + dependencies: + "@opentelemetry/core": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.53.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/d06508e7c36fe9ed8db920f2481bcaafb5cc22d6f3d0c95dd97b098ca326a8b6089e2bf3b77c106f275ed3e019576e49c5b16036943e76675b1ce80a4d427a2b + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-generic-pool@npm:0.39.0": + version: 0.39.0 + resolution: "@opentelemetry/instrumentation-generic-pool@npm:0.39.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/962b19814aa06d5dca42a94f6c94d29ab7ab81a64e951f18d712055343aed11f6ed40df95f39f71ba92ab34c47b21eec514ab93dc8323bbd7567caeebe3a2752 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-graphql@npm:0.43.0": + version: 0.43.0 + resolution: "@opentelemetry/instrumentation-graphql@npm:0.43.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/d1db48ea4af5f9352da5c644a04253908c4df1d386176ee2d2679a7f22769411a2ce10a53fd9910c11ea2d80307d0bd613ba64193b77329648e2e2da08edabf5 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-hapi@npm:0.41.0": + version: 0.41.0 + resolution: "@opentelemetry/instrumentation-hapi@npm:0.41.0" + dependencies: + "@opentelemetry/core": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/cbfecb84de7b79d9c54d2d60d881a6bbfa8cca6e2b54d4eaa3ea093b99b3fa990a03c4641bc76b36367af1c793e4f639ce0c09e3b5aed9f20f04c08076c5e31e + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-http@npm:0.53.0": + version: 0.53.0 + resolution: "@opentelemetry/instrumentation-http@npm:0.53.0" + dependencies: + "@opentelemetry/core": "npm:1.26.0" + "@opentelemetry/instrumentation": "npm:0.53.0" + "@opentelemetry/semantic-conventions": "npm:1.27.0" + semver: "npm:^7.5.2" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/421d5d9d0725dab6d2e77bf1464e0a76c22a88415854ce703d9cce7f795e4b11653d1705e7e060c61f6dba8019dd365f527b0d6332e4a8ef473f5101b5637a9c + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-ioredis@npm:0.43.0": + version: 0.43.0 + resolution: "@opentelemetry/instrumentation-ioredis@npm:0.43.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/redis-common": "npm:^0.36.2" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/81f3988baa1cd78819951eab2e2a889d0f758a8cf3ecdacb8581ee362a339050cfd3e2bf1d56cae2fdfd055ded6975b74a1a1bea793ef2ca4c1953537e63f12c + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-kafkajs@npm:0.3.0": + version: 0.3.0 + resolution: "@opentelemetry/instrumentation-kafkajs@npm:0.3.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/e29b0a0010a004418ada1277018aca316eb38de304afe7c5f5e56c60bbfd714fc7e8f0ddcd53c9a87233d1d31c57761292a0b1292496a08ccbfd954df0635a5b + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-koa@npm:0.43.0": + version: 0.43.0 + resolution: "@opentelemetry/instrumentation-koa@npm:0.43.0" + dependencies: + "@opentelemetry/core": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/d9596de9915ced84d8db2f244376420700dbb2731e044cd2091f8b32938a732e41525e50f9fa32cb95dc2f4fd560bb9a327061a44a993db034dd89a7d2e0495b + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-mongodb@npm:0.47.0": + version: 0.47.0 + resolution: "@opentelemetry/instrumentation-mongodb@npm:0.47.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/sdk-metrics": "npm:^1.9.1" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/aa3238c3fd4d8f58bb22255051b4203ca6fb2d6e45ef16fc6c3e34bd79230e9faa3f4753b5c1dbc154d50f4be832107623781ab070c63c5ae46713d0e1a65e45 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-mongoose@npm:0.42.0": + version: 0.42.0 + resolution: "@opentelemetry/instrumentation-mongoose@npm:0.42.0" + dependencies: + "@opentelemetry/core": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/993fe0a0c8eda24bf2e650a78131fcc80227b850b0c70e0a4242ed0110e0b24c2ea23125bc9bd071b5f9ac9f3c46df84e8988e7edd5f27f79b0a8a8567f2f5ad + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-mysql2@npm:0.41.0": + version: 0.41.0 + resolution: "@opentelemetry/instrumentation-mysql2@npm:0.41.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/sql-common": "npm:^0.40.1" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/a51217ff9da3ee9aca9ff956755b67068813fdd6f266b605bff5c9fe8f8b67d40ec0293c01d1817c69abc41c19e7589f7bcb24535f259cc539d42d7d32fd2232 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-mysql@npm:0.41.0": + version: 0.41.0 + resolution: "@opentelemetry/instrumentation-mysql@npm:0.41.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@types/mysql": "npm:2.15.26" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/f472b0a8f5ea240da3c616d2eb2ed14d6a6d50e98e3c40eb773894d38eff3b5f1bc2d2426240c9228eb8b3eb3717e605822a7506025dea4549055b13807680f2 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-nestjs-core@npm:0.40.0": + version: 0.40.0 + resolution: "@opentelemetry/instrumentation-nestjs-core@npm:0.40.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/d362daf6eb77fc716159f0bfbbf5685699ed7e85c14a8f241c316daa5ebc2c80a9e20dda8245e7acfbc7bcc7c95ab2d01c2c637b8d428352673fc77f862c87c6 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-pg@npm:0.44.0": + version: 0.44.0 + resolution: "@opentelemetry/instrumentation-pg@npm:0.44.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/sql-common": "npm:^0.40.1" + "@types/pg": "npm:8.6.1" + "@types/pg-pool": "npm:2.0.6" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/d20db7b7791d40cf65751dc9d79feae8694b2eb156985ef1dc1ee3ff9a230424305b24534192d9f234b87465b47d6b622e8f9e001e4665ea17d9017825835b80 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-redis-4@npm:0.42.0": + version: 0.42.0 + resolution: "@opentelemetry/instrumentation-redis-4@npm:0.42.0" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/redis-common": "npm:^0.36.2" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/4bb5408daeefc10395443fd10bd2b933c88f18658f181bd80c240f49e896c14bb520b71f2eca31fa27a4f1d82448ffceb88c2ee419eec1041f997f8a1d9a6818 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation-undici@npm:0.6.0": + version: 0.6.0 + resolution: "@opentelemetry/instrumentation-undici@npm:0.6.0" + dependencies: + "@opentelemetry/core": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.53.0" + peerDependencies: + "@opentelemetry/api": ^1.7.0 + checksum: 10c0/eafaf213f6da1ad479ee56c8cf884cf27871a40749444784ca03d77fd0c4418164f3fffaec42ad07b81a4613cdf076594e305917698663424a081b50d0c6b481 + languageName: node + linkType: hard + +"@opentelemetry/instrumentation@npm:0.53.0, @opentelemetry/instrumentation@npm:^0.53.0": + version: 0.53.0 + resolution: "@opentelemetry/instrumentation@npm:0.53.0" + dependencies: + "@opentelemetry/api-logs": "npm:0.53.0" + "@types/shimmer": "npm:^1.2.0" + import-in-the-middle: "npm:^1.8.1" + require-in-the-middle: "npm:^7.1.1" + semver: "npm:^7.5.2" + shimmer: "npm:^1.2.1" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/943e289926812272cb77cda5e0a6b662bc6a92812b66420ceeca1c764f2e3a13364f6bbed7c9e84a17ad677474101ea3c598ef6a6cca982c35bfd24be6f6a25e + languageName: node + linkType: hard + +"@opentelemetry/instrumentation@npm:^0.49 || ^0.50 || ^0.51 || ^0.52.0": + version: 0.52.1 + resolution: "@opentelemetry/instrumentation@npm:0.52.1" + dependencies: + "@opentelemetry/api-logs": "npm:0.52.1" + "@types/shimmer": "npm:^1.0.2" + import-in-the-middle: "npm:^1.8.1" + require-in-the-middle: "npm:^7.1.1" + semver: "npm:^7.5.2" + shimmer: "npm:^1.2.1" + peerDependencies: + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/1d4946b470ac31358ba8d81a9f9653a1d705db96ffb8958fef873340c3d3c9699cfd8ff617c313ea8c6a8ece51aa7cf8af37d87a60813c31ed2207e5c14a33ba + languageName: node + linkType: hard + +"@opentelemetry/redis-common@npm:^0.36.2": + version: 0.36.2 + resolution: "@opentelemetry/redis-common@npm:0.36.2" + checksum: 10c0/4cb831628551b9f13dca8d65897e300ff7be0e256b77f455a26fb053bbdfc7997b27d066ab1402ca929e7ac77598e0d593f91762d8af9f798c19ba1524e9d078 + languageName: node + linkType: hard + +"@opentelemetry/resources@npm:1.26.0, @opentelemetry/resources@npm:^1.26.0": + version: 1.26.0 + resolution: "@opentelemetry/resources@npm:1.26.0" + dependencies: + "@opentelemetry/core": "npm:1.26.0" + "@opentelemetry/semantic-conventions": "npm:1.27.0" + peerDependencies: + "@opentelemetry/api": ">=1.0.0 <1.10.0" + checksum: 10c0/62ffbf7edee8676055661cf608b32a52bfa46fedb1a88830b4d4d0faf6664edbcbf7922034d3690d11fe9ebef9d9f5ffcb05645e8c7b27c707bf57d5289617e9 + languageName: node + linkType: hard + +"@opentelemetry/sdk-metrics@npm:^1.9.1": + version: 1.26.0 + resolution: "@opentelemetry/sdk-metrics@npm:1.26.0" + dependencies: + "@opentelemetry/core": "npm:1.26.0" + "@opentelemetry/resources": "npm:1.26.0" + peerDependencies: + "@opentelemetry/api": ">=1.3.0 <1.10.0" + checksum: 10c0/640a0dcfa4af73a029ef57b51f8ecc1d08dfb0c3a5242552876fab36c7f9ae7c410fa52dbc5202a2d8675fcfe61df3c49205079963f1c11acfe42981d1d01a76 + languageName: node + linkType: hard + +"@opentelemetry/sdk-trace-base@npm:^1.22, @opentelemetry/sdk-trace-base@npm:^1.26.0": + version: 1.26.0 + resolution: "@opentelemetry/sdk-trace-base@npm:1.26.0" + dependencies: + "@opentelemetry/core": "npm:1.26.0" + "@opentelemetry/resources": "npm:1.26.0" + "@opentelemetry/semantic-conventions": "npm:1.27.0" + peerDependencies: + "@opentelemetry/api": ">=1.0.0 <1.10.0" + checksum: 10c0/0d5fc19179375f1599edae91b7232f432faf8631746835a10d0cd0c4907d0ca3ed156cc8087d4e78efdfbd9ba5ba414cc9e1399172c2aa68d7e0cd5190394d87 + languageName: node + linkType: hard + +"@opentelemetry/semantic-conventions@npm:1.27.0, @opentelemetry/semantic-conventions@npm:^1.27.0": + version: 1.27.0 + resolution: "@opentelemetry/semantic-conventions@npm:1.27.0" + checksum: 10c0/b859773ba06b7e53dd9c6b45a171bf3000e405733adbf462ae91004ed011bc80edb5beecb817fb344a085adfd06045ab5b729c9bd0f1479650ad377134fb798c + languageName: node + linkType: hard + +"@opentelemetry/sql-common@npm:^0.40.1": + version: 0.40.1 + resolution: "@opentelemetry/sql-common@npm:0.40.1" + dependencies: + "@opentelemetry/core": "npm:^1.1.0" + peerDependencies: + "@opentelemetry/api": ^1.1.0 + checksum: 10c0/60a70358f0c94f610e2995333e96b406626d67d03d38ed03b15a3461ad0f8d64afbf6275cca7cb58fe955ecdce832f3ffc9b73f9d88503bba5d2a620bbd6d351 + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -2770,6 +3152,17 @@ __metadata: languageName: node linkType: hard +"@prisma/instrumentation@npm:5.19.1": + version: 5.19.1 + resolution: "@prisma/instrumentation@npm:5.19.1" + dependencies: + "@opentelemetry/api": "npm:^1.8" + "@opentelemetry/instrumentation": "npm:^0.49 || ^0.50 || ^0.51 || ^0.52.0" + "@opentelemetry/sdk-trace-base": "npm:^1.22" + checksum: 10c0/437ca8b61815642cb511bfbe9d5ba64a94accbd4902a037ab12b68e9ca77a9bf74c9269b6b3fd02a4bfd7474209e151accc24f051dd99828568c9df5f57d4a0d + languageName: node + linkType: hard + "@radix-ui/primitive@npm:1.0.1": version: 1.0.1 resolution: "@radix-ui/primitive@npm:1.0.1" @@ -3184,6 +3577,89 @@ __metadata: languageName: node linkType: hard +"@sentry/core@npm:8.30.0": + version: 8.30.0 + resolution: "@sentry/core@npm:8.30.0" + dependencies: + "@sentry/types": "npm:8.30.0" + "@sentry/utils": "npm:8.30.0" + checksum: 10c0/5a0b9abbd30543417aa6a3e1fe7583084ec15d5cf52c271893032951e40ec04b620d68b67696e85496831dac942eb2a47fb01c6d97f63017a426a3b13fe7c5f5 + languageName: node + linkType: hard + +"@sentry/node@npm:^8.30.0": + version: 8.30.0 + resolution: "@sentry/node@npm:8.30.0" + dependencies: + "@opentelemetry/api": "npm:^1.9.0" + "@opentelemetry/context-async-hooks": "npm:^1.25.1" + "@opentelemetry/core": "npm:^1.25.1" + "@opentelemetry/instrumentation": "npm:^0.53.0" + "@opentelemetry/instrumentation-connect": "npm:0.39.0" + "@opentelemetry/instrumentation-express": "npm:0.42.0" + "@opentelemetry/instrumentation-fastify": "npm:0.39.0" + "@opentelemetry/instrumentation-fs": "npm:0.15.0" + "@opentelemetry/instrumentation-generic-pool": "npm:0.39.0" + "@opentelemetry/instrumentation-graphql": "npm:0.43.0" + "@opentelemetry/instrumentation-hapi": "npm:0.41.0" + "@opentelemetry/instrumentation-http": "npm:0.53.0" + "@opentelemetry/instrumentation-ioredis": "npm:0.43.0" + "@opentelemetry/instrumentation-kafkajs": "npm:0.3.0" + "@opentelemetry/instrumentation-koa": "npm:0.43.0" + "@opentelemetry/instrumentation-mongodb": "npm:0.47.0" + "@opentelemetry/instrumentation-mongoose": "npm:0.42.0" + "@opentelemetry/instrumentation-mysql": "npm:0.41.0" + "@opentelemetry/instrumentation-mysql2": "npm:0.41.0" + "@opentelemetry/instrumentation-nestjs-core": "npm:0.40.0" + "@opentelemetry/instrumentation-pg": "npm:0.44.0" + "@opentelemetry/instrumentation-redis-4": "npm:0.42.0" + "@opentelemetry/instrumentation-undici": "npm:0.6.0" + "@opentelemetry/resources": "npm:^1.26.0" + "@opentelemetry/sdk-trace-base": "npm:^1.26.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@prisma/instrumentation": "npm:5.19.1" + "@sentry/core": "npm:8.30.0" + "@sentry/opentelemetry": "npm:8.30.0" + "@sentry/types": "npm:8.30.0" + "@sentry/utils": "npm:8.30.0" + import-in-the-middle: "npm:^1.11.0" + checksum: 10c0/54ec05c004424eb03ed7d5ad352d0e0a0c929085f9ff07b47de0046014f1293499f746ccbf68910fc62fd0bfe2f53c3deda27feeb773f94b8a3ced090b0471b1 + languageName: node + linkType: hard + +"@sentry/opentelemetry@npm:8.30.0": + version: 8.30.0 + resolution: "@sentry/opentelemetry@npm:8.30.0" + dependencies: + "@sentry/core": "npm:8.30.0" + "@sentry/types": "npm:8.30.0" + "@sentry/utils": "npm:8.30.0" + peerDependencies: + "@opentelemetry/api": ^1.9.0 + "@opentelemetry/core": ^1.25.1 + "@opentelemetry/instrumentation": ^0.53.0 + "@opentelemetry/sdk-trace-base": ^1.26.0 + "@opentelemetry/semantic-conventions": ^1.27.0 + checksum: 10c0/71bebf23a6334d1d4655536bb0c7be1208b0b8b84446baec32e336b946d4e4f20f848d648ac7d9624002b6cb5ba335a1bd546f04f082e49e31406aa5f1095786 + languageName: node + linkType: hard + +"@sentry/types@npm:8.30.0": + version: 8.30.0 + resolution: "@sentry/types@npm:8.30.0" + checksum: 10c0/9cc57d19ebcb7b06f922373f832a268fa0023c20493370a0145def3bb0d1aa6ace7340a09e2abd28ef622eb17b4e7722d054a2a140b0a5f077c3a58614a42b0e + languageName: node + linkType: hard + +"@sentry/utils@npm:8.30.0": + version: 8.30.0 + resolution: "@sentry/utils@npm:8.30.0" + dependencies: + "@sentry/types": "npm:8.30.0" + checksum: 10c0/f65fac0f8d7ab64697b536e9399a43727056f18c4699514ef4bca2a0ef0e52eb679967b875ae42a7cd96e429baf23ee97aa84ab41bc416541d3a60c4c526e258 + languageName: node + linkType: hard + "@sindresorhus/is@npm:^4.0.0": version: 4.6.0 resolution: "@sindresorhus/is@npm:4.6.0" @@ -4368,6 +4844,15 @@ __metadata: languageName: node linkType: hard +"@types/connect@npm:3.4.36": + version: 3.4.36 + resolution: "@types/connect@npm:3.4.36" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/0dd8fcf576e178e69cbc00d47be69d3198dca4d86734a00fc55de0df147982e0a5f34592117571c5979e92ce8f3e0596e31aa454496db8a43ab90c5ab1068f40 + languageName: node + linkType: hard + "@types/cross-spawn@npm:^6.0.2": version: 6.0.6 resolution: "@types/cross-spawn@npm:6.0.6" @@ -4669,6 +5154,15 @@ __metadata: languageName: node linkType: hard +"@types/mysql@npm:2.15.26": + version: 2.15.26 + resolution: "@types/mysql@npm:2.15.26" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/3cf279e7db05d56c0544532a4380b9079f579092379a04c8138bd5cf88dda5b31208ac2d23ce7dbf4e3a3f43aaeed44e72f9f19f726518f308efe95a7435619a + languageName: node + linkType: hard + "@types/node@npm:*, @types/node@npm:^20.0.0": version: 20.12.12 resolution: "@types/node@npm:20.12.12" @@ -4708,6 +5202,37 @@ __metadata: languageName: node linkType: hard +"@types/pg-pool@npm:2.0.6": + version: 2.0.6 + resolution: "@types/pg-pool@npm:2.0.6" + dependencies: + "@types/pg": "npm:*" + checksum: 10c0/41965d4d0b677c54ce45d36add760e496d356b78019cb062d124af40287cf6b0fd4d86e3b0085f443856c185983a60c8b0795ff76d15683e2a93c62f5ac0125f + languageName: node + linkType: hard + +"@types/pg@npm:*": + version: 8.11.8 + resolution: "@types/pg@npm:8.11.8" + dependencies: + "@types/node": "npm:*" + pg-protocol: "npm:*" + pg-types: "npm:^4.0.1" + checksum: 10c0/040eb04edda338a13dccee47585b4479549fd54561e1bc3768690545adb8708a089b178e04fab9241935d7bad361314fc57af3ad87b391cfb9dc0895dd049763 + languageName: node + linkType: hard + +"@types/pg@npm:8.6.1": + version: 8.6.1 + resolution: "@types/pg@npm:8.6.1" + dependencies: + "@types/node": "npm:*" + pg-protocol: "npm:*" + pg-types: "npm:^2.2.0" + checksum: 10c0/8d16660c9a4f050d6d5e391c59f9a62e9d377a2a6a7eb5865f8828082dbdfeab700fd707e585f42d67b29e796b32863aea5bd6d5cbb8ceda2d598da5d0c61693 + languageName: node + linkType: hard + "@types/picomatch@npm:^2.3.0": version: 2.3.3 resolution: "@types/picomatch@npm:2.3.3" @@ -4832,6 +5357,13 @@ __metadata: languageName: node linkType: hard +"@types/shimmer@npm:^1.0.2, @types/shimmer@npm:^1.2.0": + version: 1.2.0 + resolution: "@types/shimmer@npm:1.2.0" + checksum: 10c0/6f7bfe1b55601cfc3ae713fc74a03341f3834253b8b91cb2add926d5949e4a63f7e666f59c2a6e40a883a5f9e2f3e3af10f9d3aed9b60fced0bda87659e58d8d + languageName: node + linkType: hard + "@types/supports-color@npm:^8.0.0": version: 8.1.3 resolution: "@types/supports-color@npm:8.1.3" @@ -5541,6 +6073,15 @@ __metadata: languageName: node linkType: hard +"acorn-import-attributes@npm:^1.9.5": + version: 1.9.5 + resolution: "acorn-import-attributes@npm:1.9.5" + peerDependencies: + acorn: ^8 + checksum: 10c0/5926eaaead2326d5a86f322ff1b617b0f698aa61dc719a5baa0e9d955c9885cc71febac3fb5bacff71bbf2c4f9c12db2056883c68c53eb962c048b952e1e013d + languageName: node + linkType: hard + "acorn-jsx@npm:^5.3.1, acorn-jsx@npm:^5.3.2": version: 5.3.2 resolution: "acorn-jsx@npm:5.3.2" @@ -6888,6 +7429,7 @@ __metadata: "@auto-it/slack": "npm:^11.1.6" "@discoveryjs/json-ext": "npm:^0.5.7" "@eslint-community/eslint-plugin-eslint-comments": "npm:^4.3.0" + "@sentry/node": "npm:^8.30.0" "@storybook/addon-essentials": "npm:^8.1.5" "@storybook/addon-webpack5-compiler-swc": "npm:^1.0.3" "@storybook/csf-tools": "npm:^8.1.5" @@ -7035,6 +7577,13 @@ __metadata: languageName: node linkType: hard +"cjs-module-lexer@npm:^1.2.2": + version: 1.4.1 + resolution: "cjs-module-lexer@npm:1.4.1" + checksum: 10c0/5a7d8279629c9ba8ccf38078c2fed75b7737973ced22b9b5a54180efa57fb2fe2bb7bec6aec55e3b8f3f5044f5d7b240347ad9bd285e7c3d0ee5b0a1d0504dfc + languageName: node + linkType: hard + "cjs-module-lexer@npm:^1.2.3": version: 1.3.1 resolution: "cjs-module-lexer@npm:1.3.1" @@ -10838,6 +11387,18 @@ __metadata: languageName: node linkType: hard +"import-in-the-middle@npm:^1.11.0, import-in-the-middle@npm:^1.8.1": + version: 1.11.0 + resolution: "import-in-the-middle@npm:1.11.0" + dependencies: + acorn: "npm:^8.8.2" + acorn-import-attributes: "npm:^1.9.5" + cjs-module-lexer: "npm:^1.2.2" + module-details-from-path: "npm:^1.0.3" + checksum: 10c0/b5b52b635450f69640289b9b597fef796ef9aa6c231ae22583a1c2e97bd1b61aa0048d7fc143b4af3ec5bffb7d64131302ed0882f62e0e2d60f0a4f009daff3f + languageName: node + linkType: hard + "import-meta-resolve@npm:^4.0.0": version: 4.1.0 resolution: "import-meta-resolve@npm:4.1.0" @@ -13625,6 +14186,13 @@ __metadata: languageName: node linkType: hard +"module-details-from-path@npm:^1.0.3": + version: 1.0.3 + resolution: "module-details-from-path@npm:1.0.3" + checksum: 10c0/3d881f3410c142e4c2b1307835a2862ba04e5b3ec6e90655614a0ee2c4b299b4c1d117fb525d2435bf436990026f18d338a197b54ad6bd36252f465c336ff423 + languageName: node + linkType: hard + "mri@npm:^1.1.0": version: 1.2.0 resolution: "mri@npm:1.2.0" @@ -14152,6 +14720,13 @@ __metadata: languageName: node linkType: hard +"obuf@npm:~1.1.2": + version: 1.1.2 + resolution: "obuf@npm:1.1.2" + checksum: 10c0/520aaac7ea701618eacf000fc96ae458e20e13b0569845800fc582f81b386731ab22d55354b4915d58171db00e79cfcd09c1638c02f89577ef092b38c65b7d81 + languageName: node + linkType: hard + "ohash@npm:^1.1.3": version: 1.1.3 resolution: "ohash@npm:1.1.3" @@ -14722,6 +15297,55 @@ __metadata: languageName: node linkType: hard +"pg-int8@npm:1.0.1": + version: 1.0.1 + resolution: "pg-int8@npm:1.0.1" + checksum: 10c0/be6a02d851fc2a4ae3e9de81710d861de3ba35ac927268973eb3cb618873a05b9424656df464dd43bd7dc3fc5295c3f5b3c8349494f87c7af50ec59ef14e0b98 + languageName: node + linkType: hard + +"pg-numeric@npm:1.0.2": + version: 1.0.2 + resolution: "pg-numeric@npm:1.0.2" + checksum: 10c0/43dd9884e7b52c79ddc28d2d282d7475fce8bba13452d33c04ceb2e0a65f561edf6699694e8e1c832ff9093770496363183c950dd29608e1bdd98f344b25bca9 + languageName: node + linkType: hard + +"pg-protocol@npm:*": + version: 1.6.1 + resolution: "pg-protocol@npm:1.6.1" + checksum: 10c0/7eadef4010ac0a3925c460be7332ca4098a5c6d5181725a62193fcfa800000ae6632d98d814f3989b42cf5fdc3b45e34c714a1959d29174e81e30730e140ae5f + languageName: node + linkType: hard + +"pg-types@npm:^2.2.0": + version: 2.2.0 + resolution: "pg-types@npm:2.2.0" + dependencies: + pg-int8: "npm:1.0.1" + postgres-array: "npm:~2.0.0" + postgres-bytea: "npm:~1.0.0" + postgres-date: "npm:~1.0.4" + postgres-interval: "npm:^1.1.0" + checksum: 10c0/ab3f8069a323f601cd2d2279ca8c425447dab3f9b61d933b0601d7ffc00d6200df25e26a4290b2b0783b59278198f7dd2ed03e94c4875797919605116a577c65 + languageName: node + linkType: hard + +"pg-types@npm:^4.0.1": + version: 4.0.2 + resolution: "pg-types@npm:4.0.2" + dependencies: + pg-int8: "npm:1.0.1" + pg-numeric: "npm:1.0.2" + postgres-array: "npm:~3.0.1" + postgres-bytea: "npm:~3.0.0" + postgres-date: "npm:~2.1.0" + postgres-interval: "npm:^3.0.0" + postgres-range: "npm:^1.1.1" + checksum: 10c0/780fccda2f3fa2a34e85a72e8e7dadb7d88fbe71ce88f126cb3313f333ad836d02488ec4ff3d94d0c1e5846f735d6e6c6281f8059e6b8919d2180429acaec3e2 + languageName: node + linkType: hard + "picocolors@npm:^1.0.0, picocolors@npm:^1.0.1": version: 1.0.1 resolution: "picocolors@npm:1.0.1" @@ -14957,6 +15581,73 @@ __metadata: languageName: node linkType: hard +"postgres-array@npm:~2.0.0": + version: 2.0.0 + resolution: "postgres-array@npm:2.0.0" + checksum: 10c0/cbd56207e4141d7fbf08c86f2aebf21fa7064943d3f808ec85f442ff94b48d891e7a144cc02665fb2de5dbcb9b8e3183a2ac749959e794b4a4cfd379d7a21d08 + languageName: node + linkType: hard + +"postgres-array@npm:~3.0.1": + version: 3.0.2 + resolution: "postgres-array@npm:3.0.2" + checksum: 10c0/644aa071f67a66a59f641f8e623887d2b915bc102a32643e2aa8b54c11acd343c5ad97831ea444dd37bd4b921ba35add4aa2cb0c6b76700a8252c2324aeba5b4 + languageName: node + linkType: hard + +"postgres-bytea@npm:~1.0.0": + version: 1.0.0 + resolution: "postgres-bytea@npm:1.0.0" + checksum: 10c0/febf2364b8a8953695cac159eeb94542ead5886792a9627b97e33f6b5bb6e263bc0706ab47ec221516e79fbd6b2452d668841830fb3b49ec6c0fc29be61892ce + languageName: node + linkType: hard + +"postgres-bytea@npm:~3.0.0": + version: 3.0.0 + resolution: "postgres-bytea@npm:3.0.0" + dependencies: + obuf: "npm:~1.1.2" + checksum: 10c0/41c79cc48aa730c5ba3eda6ab989a940034f07a1f57b8f2777dce56f1b8cca16c5870582932b5b10cc605048aef9b6157e06253c871b4717cafc6d00f55376aa + languageName: node + linkType: hard + +"postgres-date@npm:~1.0.4": + version: 1.0.7 + resolution: "postgres-date@npm:1.0.7" + checksum: 10c0/0ff91fccc64003e10b767fcfeefb5eaffbc522c93aa65d5051c49b3c4ce6cb93ab091a7d22877a90ad60b8874202c6f1d0f935f38a7235ed3b258efd54b97ca9 + languageName: node + linkType: hard + +"postgres-date@npm:~2.1.0": + version: 2.1.0 + resolution: "postgres-date@npm:2.1.0" + checksum: 10c0/00a7472c10788f6b0d08d24108bf1eb80858de1bd6317740198a564918ea4a69b80c98148167b92ae688abd606483020d0de0dd3a36f3ea9a3e26bbeef3464f4 + languageName: node + linkType: hard + +"postgres-interval@npm:^1.1.0": + version: 1.2.0 + resolution: "postgres-interval@npm:1.2.0" + dependencies: + xtend: "npm:^4.0.0" + checksum: 10c0/c1734c3cb79e7f22579af0b268a463b1fa1d084e742a02a7a290c4f041e349456f3bee3b4ee0bb3f226828597f7b76deb615c1b857db9a742c45520100456272 + languageName: node + linkType: hard + +"postgres-interval@npm:^3.0.0": + version: 3.0.0 + resolution: "postgres-interval@npm:3.0.0" + checksum: 10c0/8b570b30ea37c685e26d136d34460f246f98935a1533defc4b53bb05ee23ae3dc7475b718ec7ea607a57894d8c6b4f1adf67ca9cc83a75bdacffd427d5c68de8 + languageName: node + linkType: hard + +"postgres-range@npm:^1.1.1": + version: 1.1.4 + resolution: "postgres-range@npm:1.1.4" + checksum: 10c0/254494ef81df208e0adeae6b66ce394aba37914ea14c7ece55a45fb6691b7db04bee74c825380a47c887a9f87158fd3d86f758f9cc60b76d3a38ce5aca7912e8 + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -16043,6 +16734,17 @@ __metadata: languageName: node linkType: hard +"require-in-the-middle@npm:^7.1.1": + version: 7.4.0 + resolution: "require-in-the-middle@npm:7.4.0" + dependencies: + debug: "npm:^4.3.5" + module-details-from-path: "npm:^1.0.3" + resolve: "npm:^1.22.8" + checksum: 10c0/67c2242ea5b059c2a10c01d4f409233c67278051b47b9bf83198ab7e3ea591ffe3fa1d97912180d7d3d9a5e44490c00c55882b702849d61ac4db87d2c3823cb0 + languageName: node + linkType: hard + "requireg@npm:^0.2.2": version: 0.2.2 resolution: "requireg@npm:0.2.2" @@ -16487,7 +17189,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.6.1, semver@npm:^7.6.3": +"semver@npm:^7.5.2, semver@npm:^7.6.1, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -16631,6 +17333,13 @@ __metadata: languageName: node linkType: hard +"shimmer@npm:^1.2.1": + version: 1.2.1 + resolution: "shimmer@npm:1.2.1" + checksum: 10c0/ae8b27c389db2a00acfc8da90240f11577685a8f3e40008f826a3bea8b4f3b3ecd305c26be024b4a0fd3b123d132c1569d6e238097960a9a543b6c60760fb46a + languageName: node + linkType: hard + "side-channel@npm:^1.0.4, side-channel@npm:^1.0.6": version: 1.0.6 resolution: "side-channel@npm:1.0.6" @@ -19474,7 +20183,7 @@ __metadata: languageName: node linkType: hard -"xtend@npm:~4.0.1": +"xtend@npm:^4.0.0, xtend@npm:~4.0.1": version: 4.0.2 resolution: "xtend@npm:4.0.2" checksum: 10c0/366ae4783eec6100f8a02dff02ac907bf29f9a00b82ac0264b4d8b832ead18306797e283cf19de776538babfdcb2101375ec5646b59f08c52128ac4ab812ed0e From 3a8a8f3e8197736520a06e044b3942ea30cb516d Mon Sep 17 00:00:00 2001 From: John Hobbs Date: Wed, 11 Sep 2024 09:37:02 -0500 Subject: [PATCH 2/6] Add Sentry error monitoring --- action-src/main.ts | 7 ++++++- bin-src/main.ts | 13 ++++++++++--- node-src/errorMonitoring.ts | 12 ++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 node-src/errorMonitoring.ts diff --git a/action-src/main.ts b/action-src/main.ts index c80cd0b29..e6e52f409 100755 --- a/action-src/main.ts +++ b/action-src/main.ts @@ -1,5 +1,9 @@ +import setup from '../node-src/errorMonitoring'; +setup('action'); + import { error, getInput, getMultilineInput, setFailed, setOutput } from '@actions/core'; import { context } from '@actions/github'; +import * as Sentry from '@sentry/node'; import path from 'path'; import { run as runNode } from '../node-src'; @@ -204,7 +208,8 @@ async function run() { process.exit(1); } } + run().catch((e) => { error(e); setFailed(e.message); -}); +}).finally(() => Sentry.flush(1000)); diff --git a/bin-src/main.ts b/bin-src/main.ts index 67042282b..e17c65898 100755 --- a/bin-src/main.ts +++ b/bin-src/main.ts @@ -1,4 +1,8 @@ +import setup from '../node-src/errorMonitoring'; +setup('cli'); + import { run } from '../node-src'; +import * as Sentry from '@sentry/node'; /** * The main entrypoint for the CLI. @@ -6,7 +10,10 @@ import { run } from '../node-src'; * @param argv A list of arguments passed. */ export async function main(argv: string[]) { - const { code } = await run({ argv }); - - process.exit(code); + try { + const { code } = await run({ argv }); + process.exitCode = code; + } finally { + await Sentry.flush(1000); + } } diff --git a/node-src/errorMonitoring.ts b/node-src/errorMonitoring.ts new file mode 100644 index 000000000..c05fb7c16 --- /dev/null +++ b/node-src/errorMonitoring.ts @@ -0,0 +1,12 @@ +import * as Sentry from '@sentry/node'; + +export default (environment: string) => { + Sentry.init({ + dsn: 'https://4fa173db2ef3fb073b8ea153a5466d28@o4504181686599680.ingest.us.sentry.io/4507930289373184', + sampleRate: 1.0, + environment, + enabled: process.env.DISABLE_ERROR_MONITORING !== 'true', + enableTracing: false, + integrations: [], + }); +} From 92545f809cdacebab400e4c538a6fc8f69c03f40 Mon Sep 17 00:00:00 2001 From: John Hobbs Date: Thu, 12 Sep 2024 15:48:52 -0500 Subject: [PATCH 3/6] Add NPM package version to initial scope --- node-src/errorMonitoring.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/node-src/errorMonitoring.ts b/node-src/errorMonitoring.ts index c05fb7c16..4f7a676f1 100644 --- a/node-src/errorMonitoring.ts +++ b/node-src/errorMonitoring.ts @@ -3,10 +3,15 @@ import * as Sentry from '@sentry/node'; export default (environment: string) => { Sentry.init({ dsn: 'https://4fa173db2ef3fb073b8ea153a5466d28@o4504181686599680.ingest.us.sentry.io/4507930289373184', - sampleRate: 1.0, + sampleRate: 1, environment, enabled: process.env.DISABLE_ERROR_MONITORING !== 'true', enableTracing: false, integrations: [], + initialScope: { + tags: { + version: process.env.npm_package_version, + }, + }, }); -} +}; From 20e615fa6ed02de29f292f21a3827c2fac9527e7 Mon Sep 17 00:00:00 2001 From: John Hobbs Date: Fri, 13 Sep 2024 15:22:22 -0500 Subject: [PATCH 4/6] Use environment to determine cli vs. action in Sentry init --- action-src/main.ts | 27 ++++++++++++++------------- bin-src/main.ts | 8 ++++---- node-src/errorMonitoring.ts | 26 ++++++++++++-------------- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/action-src/main.ts b/action-src/main.ts index e6e52f409..4e04f4059 100755 --- a/action-src/main.ts +++ b/action-src/main.ts @@ -1,5 +1,4 @@ -import setup from '../node-src/errorMonitoring'; -setup('action'); +import '../node-src/errorMonitoring'; import { error, getInput, getMultilineInput, setFailed, setOutput } from '@actions/core'; import { context } from '@actions/github'; @@ -19,7 +18,7 @@ const maybe = (a: string | string[], b: any = undefined) => { try { return JSON.parse(a); - } catch (_err) { + } catch { return a; } }; @@ -192,24 +191,26 @@ async function run() { }, }); - Object.entries(output).forEach(([key, value]) => setOutput(key, String(value))); + for (const [key, value] of Object.entries(output)) setOutput(key, String(value)); if (output.code !== 0) { setFailed('non-zero exit code'); } process.exit(output.code); - } catch (e) { - if (e.message) error(e.message); - if (e.stack) error(e.stack); - if (e.description) error(e.description); + } catch (error_) { + if (error_.message) error(error_.message); + if (error_.stack) error(error_.stack); + if (error_.description) error(error_.description); - setFailed(e.message); + setFailed(error_.message); process.exit(1); } } -run().catch((e) => { - error(e); - setFailed(e.message); -}).finally(() => Sentry.flush(1000)); +run() + .catch((error_) => { + error(error_); + setFailed(error_.message); + }) + .finally(() => Sentry.close(1000)); diff --git a/bin-src/main.ts b/bin-src/main.ts index e17c65898..aad950b01 100755 --- a/bin-src/main.ts +++ b/bin-src/main.ts @@ -1,9 +1,9 @@ -import setup from '../node-src/errorMonitoring'; -setup('cli'); +import '../node-src/errorMonitoring'; -import { run } from '../node-src'; import * as Sentry from '@sentry/node'; +import { run } from '../node-src'; + /** * The main entrypoint for the CLI. * @@ -14,6 +14,6 @@ export async function main(argv: string[]) { const { code } = await run({ argv }); process.exitCode = code; } finally { - await Sentry.flush(1000); + await Sentry.close(1000); } } diff --git a/node-src/errorMonitoring.ts b/node-src/errorMonitoring.ts index 4f7a676f1..f41445579 100644 --- a/node-src/errorMonitoring.ts +++ b/node-src/errorMonitoring.ts @@ -1,17 +1,15 @@ import * as Sentry from '@sentry/node'; -export default (environment: string) => { - Sentry.init({ - dsn: 'https://4fa173db2ef3fb073b8ea153a5466d28@o4504181686599680.ingest.us.sentry.io/4507930289373184', - sampleRate: 1, - environment, - enabled: process.env.DISABLE_ERROR_MONITORING !== 'true', - enableTracing: false, - integrations: [], - initialScope: { - tags: { - version: process.env.npm_package_version, - }, +Sentry.init({ + dsn: 'https://4fa173db2ef3fb073b8ea153a5466d28@o4504181686599680.ingest.us.sentry.io/4507930289373184', + sampleRate: 1, + environment: process.env.CI && process.env.GITHUB_RUN_ID ? 'action' : 'cli', + enabled: process.env.DISABLE_ERROR_MONITORING !== 'true', + enableTracing: false, + integrations: [], + initialScope: { + tags: { + version: process.env.npm_package_version, }, - }); -}; + }, +}); From d941f616fb972c15417d5a38cc51f056d3878d8f Mon Sep 17 00:00:00 2001 From: John Hobbs Date: Fri, 13 Sep 2024 16:07:37 -0500 Subject: [PATCH 5/6] Add explicit Sentry.captureException calls --- action-src/main.ts | 9 +++++---- bin-src/main.ts | 5 ++++- node-src/index.ts | 4 ++++ node-src/lib/checkForUpdates.ts | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/action-src/main.ts b/action-src/main.ts index 4e04f4059..78cc44d3e 100755 --- a/action-src/main.ts +++ b/action-src/main.ts @@ -209,8 +209,9 @@ async function run() { } run() - .catch((error_) => { - error(error_); - setFailed(error_.message); + .catch((runError) => { + error(runError); + setFailed(runError.message); + Sentry.captureException(runError); }) - .finally(() => Sentry.close(1000)); + .finally(() => Sentry.flush(2500).finally(() => process.exit())); diff --git a/bin-src/main.ts b/bin-src/main.ts index aad950b01..f767bfb93 100755 --- a/bin-src/main.ts +++ b/bin-src/main.ts @@ -13,7 +13,10 @@ export async function main(argv: string[]) { try { const { code } = await run({ argv }); process.exitCode = code; + } catch (err) { + Sentry.captureException(err); } finally { - await Sentry.close(1000); + await Sentry.flush(2500); + process.exit(); } } diff --git a/node-src/index.ts b/node-src/index.ts index 71f3e3a7f..dd190ff38 100644 --- a/node-src/index.ts +++ b/node-src/index.ts @@ -1,5 +1,6 @@ import 'any-observable/register/zen'; +import * as Sentry from '@sentry/node'; import Listr from 'listr'; import readPkgUp from 'read-pkg-up'; import { v4 as uuid } from 'uuid'; @@ -161,6 +162,7 @@ export async function runAll(ctx: InitialContext) { ctx.log.info(''); const onError = (err: Error | Error[]) => { + Sentry.captureException(err); ctx.log.info(''); ctx.log.error(fatalError(ctx, [err].flat())); ctx.extraOptions?.experimental_onTaskError?.(ctx, { @@ -264,6 +266,8 @@ async function runBuild(ctx: Context) { ctx.log.flush(); } } catch (error) { + Sentry.captureException(error); + const errors = [error].flat(); // GraphQLClient might throw an array of errors const formattedError = fatalError(ctx, errors); diff --git a/node-src/lib/checkForUpdates.ts b/node-src/lib/checkForUpdates.ts index 27c9b74d7..e7a4ab28f 100644 --- a/node-src/lib/checkForUpdates.ts +++ b/node-src/lib/checkForUpdates.ts @@ -1,3 +1,4 @@ +import * as Sentry from '@sentry/node'; import semver from 'semver'; import { hasYarn } from 'yarn-or-npm'; @@ -45,6 +46,7 @@ export default async function checkForUpdates(ctx: Context) { } latestVersion = distributionTags.latest; } catch (err) { + Sentry.captureException(err); ctx.log.warn(`Could not retrieve package info from registry; skipping update check`); ctx.log.warn(err); return; From d6f1e9d3da316cc735f102857b9bfe77c3d6c636 Mon Sep 17 00:00:00 2001 From: John Hobbs Date: Mon, 30 Sep 2024 15:44:52 -0500 Subject: [PATCH 6/6] Move Sentry capture up stack --- node-src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/node-src/index.ts b/node-src/index.ts index dd190ff38..9e2c9eacc 100644 --- a/node-src/index.ts +++ b/node-src/index.ts @@ -234,6 +234,7 @@ async function runBuild(ctx: Context) { await new Listr(getTasks(ctx.options), options).run(ctx); ctx.log.debug('Tasks completed'); } catch (err) { + Sentry.captureException(err); endActivity(ctx); if (err.code === 'ECONNREFUSED' || err.name === 'StatusCodeError') { setExitCode(ctx, exitCodes.FETCH_ERROR); @@ -266,8 +267,6 @@ async function runBuild(ctx: Context) { ctx.log.flush(); } } catch (error) { - Sentry.captureException(error); - const errors = [error].flat(); // GraphQLClient might throw an array of errors const formattedError = fatalError(ctx, errors);