chore(deps): upgrade @sentry/node to 10.x with unchanged reporting behaviour - #409
chore(deps): upgrade @sentry/node to 10.x with unchanged reporting behaviour#409so0k wants to merge 5 commits into
Conversation
jsteinich
left a comment
There was a problem hiding this comment.
Reviewed as part of the full tele/s1–tele/s6 stack. This one is a clean, self-contained upgrade and is mergeable independently. Two things before it lands.
Pin the version, and set enableMetrics explicitly
^10.73.0 breaks this repo's exact-pinning convention — every other dependency in these three package.json files is pinned exactly (ci-info: 4.4.0, chalk: 4.1.2, and the 7.120.4 this replaces).
The caret is riskier than usual here because metrics delivery in the later PRs depends on an undeclared default. In @sentry/core@10.73.0, metrics/internal.js:
const metricsEnabled = enableMetrics ?? _experiments?.enableMetrics ?? true;Nothing in Sentry.init sets enableMetrics, so we're relying on that ?? true fallback. A minor bump that flips the default silently kills all usage telemetry, with no test failure anywhere in the stack — the unit tests mock @sentry/node, and the only oracle that would catch it is the e2e in #414.
Suggest pinning to 10.73.0 and passing enableMetrics: true explicitly in the Sentry.init options, so the behaviour is stated rather than inherited.
Test describe is mislabelled
packages/@cdktn/cli-core/src/test/error-reporting.test.ts:42 reads describe("consent gating (initializErrorReporting)", ...), but neither test covers consent gating — one asserts the fresh trace seeding, the other the pinned init options. Something like "Sentry init hardening" would match the contents. (Consent gating does get covered in #411, which is presumably where the name came from.)
88ab178 to
84c9f09
Compare
|
Both done. |
|
Approved ✅ Verified the Sentry v7 → v10 migration against the installed
Checks run:
No blockers. |
Part 1 of 6 in a stack; review order S1 → S6; base is the previous slice (this one is based on
main).chore(deps): upgrade @sentry/node to 10.x with unchanged reporting behaviour(this PR)fix(cli): stop the top-level error handler racing yargsfeat(cli): replace HashiCorp checkpoint telemetry with Sentry usage metrics and consentfeat(cli): report the installed binary, target versions and platform in usage metricsfeat(cli): report per-stack, per-provider and per-command usage metricschore(gha): run the telemetry delivery e2e on every buildRelated issue
Part of #48
Description
Sentry sunset the 7.x custom-metrics product server side on 2024-10-07, so on
@sentry/node7.120.4any metric emission is a silent no-op. The usage metrics that replace the HashiCorp checkpoint transport (S3 onwards) therefore need the v10 metrics API. This slice is that upgrade on its own, with error and crash reporting behaviour deliberately unchanged, so the SDK bump can be reviewed and bisected apart from the telemetry work.What changes:
packages/@cdktn/commons/package.json,packages/@cdktn/cli-core/package.json,packages/cdktn-cli/package.json:@sentry/nodemoves to^10.73.0in all three at once, so the bundle keeps a single shared SDK instance.pnpm-lock.yamlis regenerated; only@sentry/*and its transitives move.packages/@cdktn/cli-core/src/lib/error-reporting.ts:Sentry.configureScopebecomesgetCurrentScope(), and theSentry.initoption block is rebuilt for v10. Options removed by the SDK are dropped,tracesSampleRate: 0is pinned (metrics deliver independently of trace sampling),environmentis pinned toproductionsoSENTRY_ENVIRONMENTis never read, a fresh propagation context is set so an inheritedSENTRY_TRACE/SENTRY_BAGGAGEis discarded, andserverNameis fixed tocdktn-cli.packages/@cdktn/commons/src/errors.ts: the same scope-API change insidesetScope. The factories themselves are untouched here.packages/@cdktn/cli-core/src/test/error-reporting.test.ts: the init-options assertion (release,tracesSampleRate: 0,serverName,environment) plus the mock-factory shape it needs.The one visible effect on today's behaviour is a privacy improvement that falls out of the fixed
serverName: crash reports no longer carry the machine hostname, which the SDK attached by default. Nothing else about what is reported, or when, changes in this slice; there is still no usage telemetry of any kind here.Start with the
Sentry.initoption block inpackages/@cdktn/cli-core/src/lib/error-reporting.ts, then the matching assertion inpackages/@cdktn/cli-core/src/test/error-reporting.test.ts, then the lockfile delta.Reading order for this slice:
packages/@cdktn/cli-core/src/lib/error-reporting.tspackages/@cdktn/commons/src/errors.tspackages/@cdktn/cli-core/src/test/error-reporting.test.tspackage.jsonfiles andpnpm-lock.yamlTest plan
@cdktn/commons,@cdktn/cli-coreandcdktn-clion this slice againstmaintracesSampleRate: 0,serverName: "cdktn-cli"andenvironment: "production"shouldReportCrashandcaptureExceptiontests pass untouchedpnpm installlockfile delta inspected: only@sentry/*and its transitive dependencies movepnpm prettier --check .cleanFollow-ups (documented, not in this PR)
@sentry/nodeis a devDependency ofcdktn-cli(it reaches users through the bundle and through@cdktn/commons). Worth confirming that is intended rather than incidental.Checklist