Skip to content

Commit 79b1618

Browse files
authored
Merge pull request #9488 from getsentry/prepare-release/7.79.0
meta: Update CHANGELOG for 7.79.0
2 parents c1514ba + 3b09ca9 commit 79b1618

File tree

20 files changed

+76
-92
lines changed

20 files changed

+76
-92
lines changed

CHANGELOG.md

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

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

7+
## 7.79.0
8+
9+
- feat(tracing): Add span `origin` to trace context (#9472)
10+
- fix(deno): Emit .mjs files (#9485)
11+
- fix(nextjs): Flush servercomponent events for edge (#9487)
12+
713
## 7.78.0
814

915
### Important Changes

packages/core/src/tracing/span.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ export class Span implements SpanInterface {
332332
status: this.status,
333333
tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
334334
trace_id: this.traceId,
335+
origin: this.origin,
335336
});
336337
}
337338

packages/deno/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
## Links
1414

15+
- [SDK on Deno registry](https://deno.land/x/sentry)
1516
- [Official SDK Docs](https://docs.sentry.io/quickstart/)
1617
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)
1718

@@ -23,6 +24,10 @@ To use this SDK, call `Sentry.init(options)` as early as possible in the main en
2324
hook into the environment. Note that you can turn off almost all side effects using the respective options.
2425

2526
```javascript
27+
// Import from the Deno registry
28+
import * as Sentry from "https://deno.land/x/sentry/index.mjs";
29+
30+
// or import from npm registry
2631
import * as Sentry from 'npm:@sentry/deno';
2732

2833
Sentry.init({
@@ -31,7 +36,7 @@ Sentry.init({
3136
});
3237
```
3338

34-
To set context information or send manual events, use the exported functions of `@sentry/deno`. Note that these
39+
To set context information or send manual events, use the exported functions of the Deno SDK. Note that these
3540
functions will not perform any action before you have called `init()`:
3641

3742
```javascript

packages/deno/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/deno",
77
"author": "Sentry",
88
"license": "MIT",
9-
"main": "build/index.js",
109
"module": "build/index.js",
1110
"types": "build/index.d.ts",
1211
"publishConfig": {
@@ -51,7 +50,7 @@
5150
"pretest": "run-s deno-types test:build",
5251
"test": "run-s install:deno test:types test:unit",
5352
"test:build": "tsc -p tsconfig.test.types.json && rollup -c rollup.test.config.js",
54-
"test:types": "deno check ./build/index.js",
53+
"test:types": "deno check ./build/index.mjs",
5554
"test:unit": "deno test --allow-read --allow-run",
5655
"test:unit:update": "deno test --allow-read --allow-write --allow-run -- --update",
5756
"yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push"

packages/deno/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineConfig({
77
input: ['src/index.ts'],
88
treeshake: 'smallest',
99
output: {
10-
dir: 'build',
10+
file: 'build/index.mjs',
1111
sourcemap: true,
1212
preserveModules: false,
1313
strict: false,

packages/deno/test/example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Sentry from '../build/index.js';
1+
import * as Sentry from '../build/index.mjs';
22

33
Sentry.init({
44
dsn: 'https://[email protected]/4505526893805568',

packages/deno/test/mod.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { assertSnapshot } from 'https://deno.land/[email protected]/testing/snapshot.t
33

44
import type { sentryTypes } from '../build-test/index.js';
55
import { sentryUtils } from '../build-test/index.js';
6-
import { defaultIntegrations, DenoClient, Hub, Scope } from '../build/index.js';
6+
import { defaultIntegrations, DenoClient, Hub, Scope } from '../build/index.mjs';
77
import { getNormalizedEvent } from './normalize.ts';
88
import { makeTestTransport } from './transport.ts';
99

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const dynamic = 'force-dynamic';
2+
3+
export const runtime = 'edge';
4+
5+
export default async function Page() {
6+
throw new Error('Edge Server Component Error');
7+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { test, expect } from '@playwright/test';
2+
import { waitForError } from '../event-proxy-server';
3+
4+
test('Should record exceptions for faulty edge server components', async ({ page }) => {
5+
const errorEventPromise = waitForError('nextjs-13-app-dir', errorEvent => {
6+
return errorEvent?.exception?.values?.[0]?.value === 'Edge Server Component Error';
7+
});
8+
9+
await page.goto('/edge-server-components/error');
10+
11+
expect(await errorEventPromise).toBeDefined();
12+
});

packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/propagation.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
7171
'http.status_code': 200,
7272
},
7373
trace_id: traceId,
74+
origin: 'auto.http.otel.http',
7475
},
7576
}),
7677
}),
@@ -93,6 +94,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
9394
'http.status_code': 200,
9495
},
9596
trace_id: traceId,
97+
origin: 'auto.http.otel.http',
9698
},
9799
}),
98100
}),
@@ -162,6 +164,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
162164
'http.status_code': 200,
163165
},
164166
trace_id: traceId,
167+
origin: 'auto.http.otel.http',
165168
},
166169
}),
167170
}),
@@ -184,6 +187,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
184187
'http.status_code': 200,
185188
},
186189
trace_id: traceId,
190+
origin: 'auto.http.otel.http',
187191
},
188192
}),
189193
}),

packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/transactions.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
3636
'http.status_code': 200,
3737
},
3838
trace_id: expect.any(String),
39+
origin: 'auto.http.otel.http',
3940
},
4041
}),
4142

packages/nextjs/src/common/wrapServerComponentWithSentry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
addTracingExtensions,
33
captureException,
4+
flush,
45
getCurrentHub,
56
runWithAsyncContext,
67
startTransaction,
@@ -81,6 +82,7 @@ export function wrapServerComponentWithSentry<F extends (...args: any[]) => any>
8182
maybePromiseResult = originalFunction.apply(thisArg, args);
8283
} catch (e) {
8384
handleErrorCase(e);
85+
void flush();
8486
throw e;
8587
}
8688

@@ -94,12 +96,14 @@ export function wrapServerComponentWithSentry<F extends (...args: any[]) => any>
9496
handleErrorCase(e);
9597
},
9698
);
99+
void flush();
97100

98101
// It is very important that we return the original promise here, because Next.js attaches various properties
99102
// to that promise and will throw if they are not on the returned value.
100103
return maybePromiseResult;
101104
} else {
102105
transaction.finish();
106+
void flush();
103107
return maybePromiseResult;
104108
}
105109
});

packages/node-experimental/test/integration/scope.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ describe('Integration | Scope', () => {
9292
span_id: spanId,
9393
status: 'ok',
9494
trace_id: traceId,
95+
origin: 'manual',
9596
},
9697
}),
9798
spans: [],

packages/node-experimental/test/integration/transactions.test.ts

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,18 @@ describe('Integration | Transactions', () => {
3737
metadata: { requestPath: 'test-path' },
3838
},
3939
span => {
40-
if (!span) {
41-
return;
42-
}
43-
4440
Sentry.addBreadcrumb({ message: 'test breadcrumb 2', timestamp: 123456 });
4541

4642
span.setAttributes({
4743
'test.outer': 'test value',
4844
});
4945

5046
const subSpan = Sentry.startInactiveSpan({ name: 'inner span 1' });
51-
subSpan?.end();
47+
subSpan.end();
5248

5349
Sentry.setTag('test.tag', 'test value');
5450

5551
Sentry.startSpan({ name: 'inner span 2' }, innerSpan => {
56-
if (!innerSpan) {
57-
return;
58-
}
59-
6052
Sentry.addBreadcrumb({ message: 'test breadcrumb 3', timestamp: 123456 });
6153

6254
innerSpan.setAttributes({
@@ -97,6 +89,7 @@ describe('Integration | Transactions', () => {
9789
span_id: expect.any(String),
9890
status: 'ok',
9991
trace_id: expect.any(String),
92+
origin: 'auto.test',
10093
},
10194
},
10295
environment: 'production',
@@ -189,26 +182,18 @@ describe('Integration | Transactions', () => {
189182
Sentry.addBreadcrumb({ message: 'test breadcrumb 1', timestamp: 123456 });
190183

191184
Sentry.startSpan({ op: 'test op', name: 'test name', source: 'task', origin: 'auto.test' }, span => {
192-
if (!span) {
193-
return;
194-
}
195-
196185
Sentry.addBreadcrumb({ message: 'test breadcrumb 2', timestamp: 123456 });
197186

198187
span.setAttributes({
199188
'test.outer': 'test value',
200189
});
201190

202191
const subSpan = Sentry.startInactiveSpan({ name: 'inner span 1' });
203-
subSpan?.end();
192+
subSpan.end();
204193

205194
Sentry.setTag('test.tag', 'test value');
206195

207196
Sentry.startSpan({ name: 'inner span 2' }, innerSpan => {
208-
if (!innerSpan) {
209-
return;
210-
}
211-
212197
Sentry.addBreadcrumb({ message: 'test breadcrumb 3', timestamp: 123456 });
213198

214199
innerSpan.setAttributes({
@@ -218,26 +203,18 @@ describe('Integration | Transactions', () => {
218203
});
219204

220205
Sentry.startSpan({ op: 'test op b', name: 'test name b' }, span => {
221-
if (!span) {
222-
return;
223-
}
224-
225206
Sentry.addBreadcrumb({ message: 'test breadcrumb 2b', timestamp: 123456 });
226207

227208
span.setAttributes({
228209
'test.outer': 'test value b',
229210
});
230211

231212
const subSpan = Sentry.startInactiveSpan({ name: 'inner span 1b' });
232-
subSpan?.end();
213+
subSpan.end();
233214

234215
Sentry.setTag('test.tag', 'test value b');
235216

236217
Sentry.startSpan({ name: 'inner span 2b' }, innerSpan => {
237-
if (!innerSpan) {
238-
return;
239-
}
240-
241218
Sentry.addBreadcrumb({ message: 'test breadcrumb 3b', timestamp: 123456 });
242219

243220
innerSpan.setAttributes({
@@ -268,6 +245,7 @@ describe('Integration | Transactions', () => {
268245
span_id: expect.any(String),
269246
status: 'ok',
270247
trace_id: expect.any(String),
248+
origin: 'auto.test',
271249
},
272250
}),
273251
spans: [
@@ -309,6 +287,7 @@ describe('Integration | Transactions', () => {
309287
span_id: expect.any(String),
310288
status: 'ok',
311289
trace_id: expect.any(String),
290+
origin: 'manual',
312291
},
313292
}),
314293
spans: [
@@ -362,19 +341,11 @@ describe('Integration | Transactions', () => {
362341
context.with(
363342
trace.setSpanContext(setPropagationContextOnContext(context.active(), propagationContext), spanContext),
364343
() => {
365-
Sentry.startSpan({ op: 'test op', name: 'test name', source: 'task', origin: 'auto.test' }, span => {
366-
if (!span) {
367-
return;
368-
}
369-
344+
Sentry.startSpan({ op: 'test op', name: 'test name', source: 'task', origin: 'auto.test' }, () => {
370345
const subSpan = Sentry.startInactiveSpan({ name: 'inner span 1' });
371-
subSpan?.end();
346+
subSpan.end();
372347

373-
Sentry.startSpan({ name: 'inner span 2' }, innerSpan => {
374-
if (!innerSpan) {
375-
return;
376-
}
377-
});
348+
Sentry.startSpan({ name: 'inner span 2' }, () => {});
378349
});
379350
},
380351
);
@@ -395,6 +366,7 @@ describe('Integration | Transactions', () => {
395366
parent_span_id: parentSpanId,
396367
status: 'ok',
397368
trace_id: traceId,
369+
origin: 'auto.test',
398370
},
399371
}),
400372
// spans are circular (they have a reference to the transaction), which leads to jest choking on this
@@ -481,20 +453,12 @@ describe('Integration | Transactions', () => {
481453
let innerSpan1Id: string | undefined;
482454
let innerSpan2Id: string | undefined;
483455

484-
void Sentry.startSpan({ name: 'test name' }, async span => {
485-
if (!span) {
486-
return;
487-
}
488-
456+
void Sentry.startSpan({ name: 'test name' }, async () => {
489457
const subSpan = Sentry.startInactiveSpan({ name: 'inner span 1' });
490458
innerSpan1Id = subSpan?.spanContext().spanId;
491-
subSpan?.end();
459+
subSpan.end();
492460

493461
Sentry.startSpan({ name: 'inner span 2' }, innerSpan => {
494-
if (!innerSpan) {
495-
return;
496-
}
497-
498462
innerSpan2Id = innerSpan.spanContext().spanId;
499463
});
500464

packages/opentelemetry/test/custom/transaction.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('NodeExperimentalTransaction', () => {
2828
trace: {
2929
span_id: expect.any(String),
3030
trace_id: expect.any(String),
31+
origin: 'manual',
3132
},
3233
},
3334
spans: [],
@@ -106,6 +107,7 @@ describe('NodeExperimentalTransaction', () => {
106107
trace: {
107108
span_id: expect.any(String),
108109
trace_id: expect.any(String),
110+
origin: 'manual',
109111
},
110112
},
111113
spans: [],

packages/opentelemetry/test/integration/scope.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ describe('Integration | Scope', () => {
9898
span_id: spanId,
9999
status: 'ok',
100100
trace_id: traceId,
101+
origin: 'manual',
101102
},
102103
}),
103104

0 commit comments

Comments
 (0)