Skip to content

Commit 928e1a3

Browse files
author
Luca Forstner
committed
Merge remote-tracking branch 'origin/develop' into lforst-improve-diff-origin-stack-frames
2 parents 8828c11 + f67fa79 commit 928e1a3

File tree

64 files changed

+409
-191
lines changed

Some content is hidden

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

64 files changed

+409
-191
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@
1010

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

13-
Work in this release was contributed by @filips-alpe. Thank you for your contribution!
13+
## 9.1.0
14+
15+
- feat(browser): Add `graphqlClientIntegration` ([#13783](https://github.com/getsentry/sentry-javascript/pull/13783))
16+
- feat(core): Allow for nested trpc context ([#15379](https://github.com/getsentry/sentry-javascript/pull/15379))
17+
- feat(core): Create types and utilities for span links ([#15375](https://github.com/getsentry/sentry-javascript/pull/15375))
18+
- feat(deps): bump @opentelemetry/instrumentation-pg from 0.50.0 to 0.51.0 ([#15273](https://github.com/getsentry/sentry-javascript/pull/15273))
19+
- feat(node): Extract Sentry-specific node-fetch instrumentation ([#15231](https://github.com/getsentry/sentry-javascript/pull/15231))
20+
- feat(vue): Support Pinia v3 ([#15383](https://github.com/getsentry/sentry-javascript/pull/15383))
21+
- fix(sveltekit): Avoid request body double read errors ([#15368](https://github.com/getsentry/sentry-javascript/pull/15368))
22+
- fix(sveltekit): Avoid top-level `vite` import ([#15371](https://github.com/getsentry/sentry-javascript/pull/15371))
23+
24+
Work in this release was contributed by @Zen-cronic and @filips-alpe. Thank you for your contribution!
1425

1526
## 9.0.1
1627

dev-packages/browser-integration-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -42,7 +42,7 @@
4242
"@babel/preset-typescript": "^7.16.7",
4343
"@playwright/test": "~1.50.0",
4444
"@sentry-internal/rrweb": "2.31.0",
45-
"@sentry/browser": "9.0.1",
45+
"@sentry/browser": "9.1.0",
4646
"axios": "1.7.7",
4747
"babel-loader": "^8.2.2",
4848
"fflate": "0.8.2",

dev-packages/bundle-analyzer-scenarios/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/bundle-analyzer-scenarios",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"description": "Scenarios to test bundle analysis with",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",

dev-packages/clear-cache-gh-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sentry-internal/clear-cache-gh-action",
33
"description": "An internal Github Action to clear GitHub caches.",
4-
"version": "9.0.1",
4+
"version": "9.1.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18"

dev-packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/e2e-tests",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"license": "MIT",
55
"private": true,
66
"scripts": {

dev-packages/external-contributor-gh-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sentry-internal/external-contributor-gh-action",
33
"description": "An internal Github Action to add external contributors to the CHANGELOG.md file.",
4-
"version": "9.0.1",
4+
"version": "9.1.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18"

dev-packages/node-integration-tests/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/node-integration-tests",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"license": "MIT",
55
"engines": {
66
"node": ">=18"
@@ -16,12 +16,9 @@
1616
"build:types": "tsc -p tsconfig.types.json",
1717
"clean": "rimraf -g **/node_modules && run-p clean:script",
1818
"clean:script": "node scripts/clean.js",
19-
"prisma-v5:init": "cd suites/tracing/prisma-orm-v5 && yarn && yarn setup",
20-
"prisma-v6:init": "cd suites/tracing/prisma-orm-v6 && yarn && yarn setup",
2119
"lint": "eslint . --format stylish",
2220
"fix": "eslint . --format stylish --fix",
2321
"type-check": "tsc",
24-
"pretest": "run-s --silent prisma-v5:init prisma-v6:init",
2522
"test": "jest --config ./jest.config.js",
2623
"test:watch": "yarn test --watch"
2724
},
@@ -31,9 +28,9 @@
3128
"@nestjs/common": "10.4.6",
3229
"@nestjs/core": "10.4.6",
3330
"@nestjs/platform-express": "10.4.6",
34-
"@sentry/aws-serverless": "9.0.1",
35-
"@sentry/core": "9.0.1",
36-
"@sentry/node": "9.0.1",
31+
"@sentry/aws-serverless": "9.1.0",
32+
"@sentry/core": "9.1.0",
33+
"@sentry/node": "9.1.0",
3734
"@types/mongodb": "^3.6.20",
3835
"@types/mysql": "^2.15.21",
3936
"@types/pg": "^8.6.5",

dev-packages/node-integration-tests/suites/tracing/prisma-orm-v5/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
"node": ">=18"
88
},
99
"scripts": {
10-
"db-up": "docker compose up -d",
1110
"generate": "prisma generate",
1211
"migrate": "prisma migrate dev -n sentry-test",
13-
"setup": "run-s --silent db-up generate migrate"
12+
"setup": "run-s --silent generate migrate"
1413
},
1514
"keywords": [],
1615
"author": "",

dev-packages/node-integration-tests/suites/tracing/prisma-orm-v5/test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
import { createRunner } from '../../../utils/runner';
1+
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
22

3-
describe('Prisma ORM Tests', () => {
3+
// When running docker compose, we need a larger timeout, as this takes some time...
4+
jest.setTimeout(75000);
5+
6+
afterAll(() => {
7+
cleanupChildProcesses();
8+
});
9+
10+
describe('Prisma ORM v5 Tests', () => {
411
test('CJS - should instrument PostgreSQL queries from Prisma ORM', done => {
512
createRunner(__dirname, 'scenario.js')
13+
.withDockerCompose({
14+
workingDirectory: [__dirname],
15+
readyMatches: ['port 5432'],
16+
setupCommand: 'yarn && yarn setup',
17+
})
618
.expect({
719
transaction: transaction => {
820
expect(transaction.transaction).toBe('Test Transaction');

dev-packages/node-integration-tests/suites/tracing/prisma-orm-v6/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
"node": ">=18"
88
},
99
"scripts": {
10-
"db-up": "docker compose up -d",
1110
"generate": "prisma generate",
1211
"migrate": "prisma migrate dev -n sentry-test",
13-
"setup": "run-s --silent db-up generate migrate"
12+
"setup": "run-s --silent generate migrate"
1413
},
1514
"keywords": [],
1615
"author": "",

dev-packages/node-integration-tests/suites/tracing/prisma-orm-v6/test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
import type { SpanJSON } from '@sentry/core';
2-
import { createRunner } from '../../../utils/runner';
2+
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
33

4-
describe('Prisma ORM Tests', () => {
4+
// When running docker compose, we need a larger timeout, as this takes some time...
5+
jest.setTimeout(75000);
6+
7+
afterAll(() => {
8+
cleanupChildProcesses();
9+
});
10+
11+
describe('Prisma ORM v6 Tests', () => {
512
test('CJS - should instrument PostgreSQL queries from Prisma ORM', done => {
613
createRunner(__dirname, 'scenario.js')
14+
.withDockerCompose({
15+
workingDirectory: [__dirname],
16+
readyMatches: ['port 5432'],
17+
setupCommand: 'yarn && yarn setup',
18+
})
719
.expect({
820
transaction: transaction => {
921
expect(transaction.transaction).toBe('Test Transaction');

dev-packages/node-integration-tests/utils/runner.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable max-lines */
2-
import { spawn, spawnSync } from 'child_process';
2+
import { execSync, spawn, spawnSync } from 'child_process';
33
import { existsSync } from 'fs';
44
import { join } from 'path';
55
import { normalize } from '@sentry/core';
@@ -60,6 +60,10 @@ interface DockerOptions {
6060
* The strings to look for in the output to know that the docker compose is ready for the test to be run
6161
*/
6262
readyMatches: string[];
63+
/**
64+
* The command to run after docker compose is up
65+
*/
66+
setupCommand?: string;
6367
}
6468

6569
/**
@@ -96,6 +100,9 @@ async function runDockerCompose(options: DockerOptions): Promise<VoidFunction> {
96100
if (text.includes(match)) {
97101
child.stdout.removeAllListeners();
98102
clearTimeout(timeout);
103+
if (options.setupCommand) {
104+
execSync(options.setupCommand, { cwd, stdio: 'inherit' });
105+
}
99106
resolve(close);
100107
}
101108
}

dev-packages/rollup-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/rollup-utils",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"description": "Rollup utilities used at Sentry for the Sentry JavaScript SDK",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/rollup-utils",

dev-packages/size-limit-gh-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sentry-internal/size-limit-gh-action",
33
"description": "An internal Github Action to compare the current size of a PR against the one on develop.",
4-
"version": "9.0.1",
4+
"version": "9.1.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18"

dev-packages/test-utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"name": "@sentry-internal/test-utils",
55
"author": "Sentry",
66
"license": "MIT",
@@ -45,7 +45,7 @@
4545
},
4646
"devDependencies": {
4747
"@playwright/test": "~1.50.0",
48-
"@sentry/core": "9.0.1"
48+
"@sentry/core": "9.1.0"
4949
},
5050
"volta": {
5151
"extends": "../../package.json"

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"npmClient": "yarn"
55
}

packages/angular/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/angular",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"description": "Official Sentry SDK for Angular",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
@@ -21,8 +21,8 @@
2121
"rxjs": "^6.5.5 || ^7.x"
2222
},
2323
"dependencies": {
24-
"@sentry/browser": "9.0.1",
25-
"@sentry/core": "9.0.1",
24+
"@sentry/browser": "9.1.0",
25+
"@sentry/core": "9.1.0",
2626
"tslib": "^2.4.1"
2727
},
2828
"devDependencies": {

packages/astro/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/astro",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"description": "Official Sentry SDK for Astro",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/astro",
@@ -56,9 +56,9 @@
5656
"astro": ">=3.x || >=4.0.0-beta || >=5.x"
5757
},
5858
"dependencies": {
59-
"@sentry/browser": "9.0.1",
60-
"@sentry/core": "9.0.1",
61-
"@sentry/node": "9.0.1",
59+
"@sentry/browser": "9.1.0",
60+
"@sentry/core": "9.1.0",
61+
"@sentry/node": "9.1.0",
6262
"@sentry/vite-plugin": "^2.22.6"
6363
},
6464
"devDependencies": {

packages/aws-serverless/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/aws-serverless",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"description": "Official Sentry SDK for AWS Lambda and AWS Serverless Environments",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/serverless",
@@ -68,8 +68,8 @@
6868
"@opentelemetry/instrumentation": "^0.57.1",
6969
"@opentelemetry/instrumentation-aws-lambda": "0.50.2",
7070
"@opentelemetry/instrumentation-aws-sdk": "0.49.0",
71-
"@sentry/core": "9.0.1",
72-
"@sentry/node": "9.0.1",
71+
"@sentry/core": "9.1.0",
72+
"@sentry/node": "9.1.0",
7373
"@types/aws-lambda": "^8.10.62"
7474
},
7575
"devDependencies": {

packages/browser-utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-utils",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"description": "Browser Utilities for all Sentry JavaScript SDKs",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser-utils",
@@ -39,7 +39,7 @@
3939
"access": "public"
4040
},
4141
"dependencies": {
42-
"@sentry/core": "9.0.1"
42+
"@sentry/core": "9.1.0"
4343
},
4444
"scripts": {
4545
"build": "run-p build:transpile build:types",

packages/browser-utils/src/metrics/browserMetrics.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ export function _addMeasureSpans(
425425
startTime: number,
426426
duration: number,
427427
timeOrigin: number,
428-
): number {
428+
): void {
429429
const navEntry = getNavigationEntry(false);
430430
const requestTime = msToSec(navEntry ? navEntry.requestStart : 0);
431431
// Because performance.measure accepts arbitrary timestamps it can produce
@@ -450,13 +450,14 @@ export function _addMeasureSpans(
450450
attributes['sentry.browser.measure_start_time'] = measureStartTimestamp;
451451
}
452452

453-
startAndEndSpan(span, measureStartTimestamp, measureEndTimestamp, {
454-
name: entry.name as string,
455-
op: entry.entryType as string,
456-
attributes,
457-
});
458-
459-
return measureStartTimestamp;
453+
// Measurements from third parties can be off, which would create invalid spans, dropping transactions in the process.
454+
if (measureStartTimestamp <= measureEndTimestamp) {
455+
startAndEndSpan(span, measureStartTimestamp, measureEndTimestamp, {
456+
name: entry.name as string,
457+
op: entry.entryType as string,
458+
attributes,
459+
});
460+
}
460461
}
461462

462463
/** Instrument navigation entries */

packages/browser-utils/test/browser/browserMetrics.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,29 @@ describe('_addMeasureSpans', () => {
9292
}),
9393
);
9494
});
95+
96+
it('drops measurement spans with negative duration', () => {
97+
const spans: Span[] = [];
98+
99+
getClient()?.on('spanEnd', span => {
100+
spans.push(span);
101+
});
102+
103+
const entry = {
104+
entryType: 'measure',
105+
name: 'measure-1',
106+
duration: 10,
107+
startTime: 12,
108+
} as PerformanceEntry;
109+
110+
const timeOrigin = 100;
111+
const startTime = 23;
112+
const duration = -50;
113+
114+
_addMeasureSpans(span, entry, startTime, duration, timeOrigin);
115+
116+
expect(spans).toHaveLength(0);
117+
});
95118
});
96119

97120
describe('_addResourceSpans', () => {

0 commit comments

Comments
 (0)