Skip to content

Commit 17f490e

Browse files
authored
Merge pull request #9965 from getsentry/prepare-release/7.91.0
2 parents d76ed4f + f08bec8 commit 17f490e

File tree

369 files changed

+4878
-3394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+4878
-3394
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = {
6262
},
6363
},
6464
{
65-
files: ['scenarios/**', 'rollup/**'],
65+
files: ['scenarios/**', 'packages/rollup-utils/**'],
6666
parserOptions: {
6767
sourceType: 'module',
6868
},

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ jobs:
8686
- 'CHANGELOG.md'
8787
- '.github/**'
8888
- 'jest/**'
89-
- 'rollup/**'
9089
- 'scripts/**'
9190
- 'packages/core/**'
91+
- 'packages/rollup-utils/**'
9292
- 'packages/tracing/**'
9393
- 'packages/tracing-internal/**'
9494
- 'packages/utils/**'
@@ -176,7 +176,7 @@ jobs:
176176
# so no need to reinstall them
177177
- name: Compute dependency cache key
178178
id: compute_lockfile_hash
179-
run: echo "hash=${{ hashFiles('yarn.lock') }}" >> "$GITHUB_OUTPUT"
179+
run: echo "hash=${{ hashFiles('yarn.lock', '**/package.json') }}" >> "$GITHUB_OUTPUT"
180180

181181
- name: Check dependency cache
182182
uses: actions/cache@v3

.size-limit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = [
6060
name: '@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped)',
6161
path: 'packages/browser/build/bundles/bundle.tracing.replay.feedback.min.js',
6262
gzip: true,
63-
limit: '75 KB',
63+
limit: '90 KB',
6464
},
6565
{
6666
name: '@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped)',
@@ -101,7 +101,7 @@ module.exports = [
101101
path: 'packages/browser/build/bundles/bundle.min.js',
102102
gzip: false,
103103
brotli: false,
104-
limit: '70 KB',
104+
limit: '80 KB',
105105
},
106106

107107
// Browser CDN bundles (ES5)
@@ -110,7 +110,7 @@ module.exports = [
110110
name: '@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped)',
111111
path: 'packages/browser/build/bundles/bundle.tracing.es5.min.js',
112112
gzip: true,
113-
limit: '35 KB',
113+
limit: '40 KB',
114114
},
115115

116116
// React

CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,68 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 7.91.0
8+
9+
### Important Changes
10+
11+
- **feat: Add server runtime metrics aggregator (#9894)**
12+
13+
The release adds alpha support for [Sentry developer metrics](https://github.com/getsentry/sentry/discussions/58584) in the server runtime SDKs (`@sentry/node`, `@sentry/deno`, `@sentry/nextjs` server-side, etc.). Via the newly introduced APIs, you can now flush metrics directly to Sentry.
14+
15+
To enable capturing metrics, you first need to add the `metricsAggregator` experiment to your `Sentry.init` call.
16+
17+
```js
18+
Sentry.init({
19+
dsn: '__DSN__',
20+
_experiments: {
21+
metricsAggregator: true,
22+
},
23+
});
24+
```
25+
26+
Then you'll be able to add `counters`, `sets`, `distributions`, and `gauges` under the `Sentry.metrics` namespace.
27+
28+
```js
29+
// Add 4 to a counter named `hits`
30+
Sentry.metrics.increment('hits', 4);
31+
32+
// Add 2 to gauge named `parallel_requests`, tagged with `type: "a"`
33+
Sentry.metrics.gauge('parallel_requests', 2, { tags: { type: 'a' } });
34+
35+
// Add 4.6 to a distribution named `response_time` with unit seconds
36+
Sentry.metrics.distribution('response_time', 4.6, { unit: 'seconds' });
37+
38+
// Add 2 to a set named `valuable.ids`
39+
Sentry.metrics.set('valuable.ids', 2);
40+
```
41+
42+
- **feat(node): Rework ANR to use worker script via an integration (#9945)**
43+
44+
The [ANR tracking integration for Node](https://docs.sentry.io/platforms/node/configuration/application-not-responding/) has been reworked to use an integration. ANR tracking now requires a minimum Node version of 16 or higher. Previously you had to call `Sentry.enableANRDetection` before running your application, now you can simply add the `Anr` integration to your `Sentry.init` call.
45+
46+
```js
47+
import * as Sentry from '@sentry/node';
48+
49+
Sentry.init({
50+
dsn: 'https://[email protected]/1337',
51+
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 200 })],
52+
});
53+
```
54+
55+
### Other Changes
56+
57+
- feat(breadcrumbs): Send component names on UI breadcrumbs (#9946)
58+
- feat(core): Add `getGlobalScope()` method (#9920)
59+
- feat(core): Add `getIsolationScope()` method (#9957)
60+
- feat(core): Add `span.end()` to replace `span.finish()` (#9954)
61+
- feat(core): Ensure `startSpan` & `startSpanManual` fork scope (#9955)
62+
- feat(react): Send component name on spans (#9949)
63+
- feat(replay): Send component names in replay breadcrumbs (#9947)
64+
- feat(sveltekit): Add options to configure fetch instrumentation script for CSP (#9969)
65+
- feat(tracing): Send component name on interaction spans (#9948)
66+
- feat(utils): Add function to extract relevant component name (#9921)
67+
- fix(core): Rethrow caught promise rejections in `startSpan`, `startSpanManual`, `trace` (#9958)
68+
769
## 7.90.0
870

971
- feat(replay): Change to use preset quality values (#9903)

biome.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"suspicious": {
2121
"all": false,
2222
"noControlCharactersInRegex": "error"
23+
},
24+
"nursery": {
25+
"noUnusedImports": "error"
2326
}
2427
},
2528
"ignore": [".vscode/*", "**/*.json"]

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"scripts": {
4-
"build": "node ./scripts/verify-packages-versions.js && run-s build:types build:transpile build:bundle",
4+
"build": "node ./scripts/verify-packages-versions.js && run-s build:transpile build:types build:bundle",
55
"build:bundle": "lerna run build:bundle",
66
"build:dev": "lerna run build:types,build:transpile",
77
"build:dev:filter": "lerna run build:dev --include-filtered-dependencies --include-filtered-dependents --scope",
@@ -18,12 +18,12 @@
1818
"clean:deps": "lerna clean --yes && rm -rf node_modules && yarn",
1919
"clean:all": "run-s clean:build clean:caches clean:deps",
2020
"codecov": "codecov",
21-
"fix": "run-s fix:lerna fix:biome",
21+
"fix": "run-p fix:lerna fix:biome",
2222
"fix:lerna": "lerna run fix",
23-
"fix:biome": "biome check --apply-unsafe .",
23+
"fix:biome": "biome check --apply .",
2424
"changelog": "ts-node ./scripts/get-commit-list.ts",
2525
"link:yarn": "lerna exec yarn link",
26-
"lint": "run-s lint:lerna lint:biome",
26+
"lint": "run-p lint:lerna lint:biome",
2727
"lint:lerna": "lerna run lint",
2828
"lint:biome": "biome check .",
2929
"validate:es5": "lerna run validate:es5",
@@ -69,6 +69,7 @@
6969
"packages/remix",
7070
"packages/replay",
7171
"packages/replay-worker",
72+
"packages/rollup-utils",
7273
"packages/serverless",
7374
"packages/svelte",
7475
"packages/sveltekit",
@@ -99,7 +100,6 @@
99100
"@types/rimraf": "^3.0.2",
100101
"@types/sinon": "^7.0.11",
101102
"@vitest/coverage-c8": "^0.29.2",
102-
"acorn": "^8.7.0",
103103
"chai": "^4.1.2",
104104
"codecov": "^3.6.5",
105105
"deepmerge": "^4.2.2",
@@ -116,7 +116,6 @@
116116
"mocha": "^6.1.4",
117117
"nodemon": "^2.0.16",
118118
"npm-run-all": "^4.1.5",
119-
"recast": "^0.20.5",
120119
"replace-in-file": "^4.0.0",
121120
"rimraf": "^3.0.2",
122121
"rollup": "^2.67.1",

packages/angular/src/tracing.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class TraceService implements OnDestroy {
8282

8383
if (activeTransaction) {
8484
if (this._routingSpan) {
85-
this._routingSpan.finish();
85+
this._routingSpan.end();
8686
}
8787
this._routingSpan = activeTransaction.startChild({
8888
description: `${navigationEvent.url}`,
@@ -131,7 +131,7 @@ export class TraceService implements OnDestroy {
131131
if (this._routingSpan) {
132132
runOutsideAngular(() => {
133133
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
134-
this._routingSpan!.finish();
134+
this._routingSpan!.end();
135135
});
136136
this._routingSpan = null;
137137
}
@@ -196,7 +196,7 @@ export class TraceDirective implements OnInit, AfterViewInit {
196196
*/
197197
public ngAfterViewInit(): void {
198198
if (this._tracingSpan) {
199-
this._tracingSpan.finish();
199+
this._tracingSpan.end();
200200
}
201201
}
202202
}
@@ -239,7 +239,7 @@ export function TraceClassDecorator(): ClassDecorator {
239239
// eslint-disable-next-line @typescript-eslint/no-explicit-any
240240
target.prototype.ngAfterViewInit = function (...args: any[]): ReturnType<typeof originalAfterViewInit> {
241241
if (tracingSpan) {
242-
tracingSpan.finish();
242+
tracingSpan.end();
243243
}
244244
if (originalAfterViewInit) {
245245
return originalAfterViewInit.apply(this, args);

packages/angular/test/tracing.test.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component } from '@angular/core';
22
import type { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from '@angular/router';
3-
import type { Hub } from '@sentry/types';
43

54
import { TraceClassDecorator, TraceDirective, TraceMethodDecorator, instrumentAngularRouting } from '../src';
65
import { getParameterizedRouteFromSnapshot } from '../src/tracing';
@@ -154,7 +153,7 @@ describe('Angular Tracing', () => {
154153

155154
const finishMock = jest.fn();
156155
transaction.startChild = jest.fn(() => ({
157-
finish: finishMock,
156+
end: finishMock,
158157
}));
159158

160159
await env.navigateInAngular('/');
@@ -173,7 +172,7 @@ describe('Angular Tracing', () => {
173172

174173
const finishMock = jest.fn();
175174
transaction.startChild = jest.fn(() => ({
176-
finish: finishMock,
175+
end: finishMock,
177176
}));
178177

179178
await env.navigateInAngular('/');
@@ -199,7 +198,7 @@ describe('Angular Tracing', () => {
199198

200199
const finishMock = jest.fn();
201200
transaction.startChild = jest.fn(() => ({
202-
finish: finishMock,
201+
end: finishMock,
203202
}));
204203

205204
await env.navigateInAngular('/somewhere');
@@ -233,7 +232,7 @@ describe('Angular Tracing', () => {
233232

234233
const finishMock = jest.fn();
235234
transaction.startChild = jest.fn(() => ({
236-
finish: finishMock,
235+
end: finishMock,
237236
}));
238237

239238
await env.navigateInAngular('/cancel');
@@ -376,7 +375,7 @@ describe('Angular Tracing', () => {
376375
});
377376

378377
transaction.startChild = jest.fn(() => ({
379-
finish: finishMock,
378+
end: finishMock,
380379
}));
381380

382381
directive.componentName = 'test-component';
@@ -403,7 +402,7 @@ describe('Angular Tracing', () => {
403402
});
404403

405404
transaction.startChild = jest.fn(() => ({
406-
finish: finishMock,
405+
end: finishMock,
407406
}));
408407

409408
directive.ngOnInit();
@@ -437,7 +436,7 @@ describe('Angular Tracing', () => {
437436
it('Instruments `ngOnInit` and `ngAfterViewInit` methods of the decorated class', async () => {
438437
const finishMock = jest.fn();
439438
const startChildMock = jest.fn(() => ({
440-
finish: finishMock,
439+
end: finishMock,
441440
}));
442441

443442
const customStartTransaction = jest.fn((ctx: any) => {

packages/astro/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@
5858
"scripts": {
5959
"build": "run-p build:transpile build:types",
6060
"build:dev": "yarn build",
61-
"build:transpile": "rollup -c rollup.npm.config.js --bundleConfigAsCjs",
61+
"build:transpile": "rollup -c rollup.npm.config.mjs",
6262
"build:types": "tsc -p tsconfig.types.json",
6363
"build:watch": "run-p build:transpile:watch build:types:watch",
6464
"build:dev:watch": "yarn build:watch",
65-
"build:transpile:watch": "rollup -c rollup.npm.config.js --bundleConfigAsCjs --watch",
65+
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
6666
"build:types:watch": "tsc -p tsconfig.types.json --watch",
6767
"build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build",
6868
"circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts",

packages/astro/rollup.npm.config.js renamed to packages/astro/rollup.npm.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index.js';
1+
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';
22

33
const variants = makeNPMConfigVariants(
44
makeBaseNPMConfig({

packages/astro/src/index.server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export {
2727
getCurrentHub,
2828
getClient,
2929
getCurrentScope,
30+
getGlobalScope,
31+
getIsolationScope,
3032
Hub,
3133
makeMain,
3234
Scope,

packages/astro/test/server/middleware.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as SentryNode from '@sentry/node';
22
import type { Client } from '@sentry/types';
3-
import { SpyInstance, vi } from 'vitest';
3+
import { vi } from 'vitest';
44

55
import { handleRequest, interpolateRouteFromUrlAndParams } from '../../src/server/middleware';
66

packages/browser-integration-tests/suites/integrations/Breadcrumbs/dom/click/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
<body>
88
<button id="button1" type="button">Button 1</button>
99
<button id="button2" type="button">Button 2</button>
10+
<button id="annotated-button" type="button" data-sentry-component="AnnotatedButton">Button 3</button>
1011
</body>
1112
</html>

packages/browser-integration-tests/suites/integrations/Breadcrumbs/dom/click/test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,39 @@ sentryTest('captures Breadcrumb for clicks & debounces them for a second', async
5555
},
5656
]);
5757
});
58+
59+
sentryTest(
60+
'uses the annotated component name in the breadcrumb messages and adds it to the data object',
61+
async ({ getLocalTestUrl, page }) => {
62+
const url = await getLocalTestUrl({ testDir: __dirname });
63+
64+
await page.route('**/foo', route => {
65+
return route.fulfill({
66+
status: 200,
67+
body: JSON.stringify({
68+
userNames: ['John', 'Jane'],
69+
}),
70+
headers: {
71+
'Content-Type': 'application/json',
72+
},
73+
});
74+
});
75+
76+
const promise = getFirstSentryEnvelopeRequest<Event>(page);
77+
78+
await page.goto(url);
79+
await page.click('#annotated-button');
80+
await page.evaluate('Sentry.captureException("test exception")');
81+
82+
const eventData = await promise;
83+
84+
expect(eventData.breadcrumbs).toEqual([
85+
{
86+
timestamp: expect.any(Number),
87+
category: 'ui.click',
88+
message: 'body > AnnotatedButton',
89+
data: { 'ui.component_name': 'AnnotatedButton' },
90+
},
91+
]);
92+
},
93+
);

packages/browser-integration-tests/suites/integrations/Breadcrumbs/dom/textInput/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
<body>
88
<input id="input1" type="text" />
99
<input id="input2" type="text" />
10+
<input id="annotated-input" data-sentry-component="AnnotatedInput" type="text" />
1011
</body>
1112
</html>

0 commit comments

Comments
 (0)