Skip to content

Commit 7c8cad5

Browse files
author
Luca Forstner
authored
Merge branch 'develop' into lforst-rm-relh
2 parents 0a09a36 + 64e9fb6 commit 7c8cad5

File tree

41 files changed

+60
-887
lines changed

Some content is hidden

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

41 files changed

+60
-887
lines changed

dev-packages/e2e-tests/test-applications/node-express/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@
1515
"@sentry/node": "latest || *",
1616
"@trpc/server": "10.45.2",
1717
"@trpc/client": "10.45.2",
18-
"@types/express": "4.17.17",
18+
"@types/express": "^4.17.21",
1919
"@types/node": "^18.19.1",
20-
"express": "4.20.0",
20+
"express": "^4.21.2",
2121
"typescript": "~5.0.0",
2222
"zod": "~3.22.4"
2323
},
2424
"devDependencies": {
2525
"@playwright/test": "^1.44.1",
2626
"@sentry-internal/test-utils": "link:../../../test-utils"
2727
},
28+
"resolutions": {
29+
"@types/qs": "6.9.17"
30+
},
2831
"volta": {
2932
"extends": "../../package.json"
3033
}

dev-packages/e2e-tests/test-applications/node-express/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"types": ["node"],
44
"esModuleInterop": true,
5-
"lib": ["es2018"],
5+
"lib": ["es2020"],
66
"strict": true,
77
"outDir": "dist"
88
},

dev-packages/node-integration-tests/suites/client-reports/drop-reasons/before-send/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ afterAll(() => {
66

77
test('should record client report for beforeSend', done => {
88
createRunner(__dirname, 'scenario.ts')
9+
.unignore('client_report')
910
.expect({
1011
client_report: {
1112
discarded_events: [

dev-packages/node-integration-tests/suites/client-reports/drop-reasons/event-processors/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ afterAll(() => {
66

77
test('should record client report for event processors', done => {
88
createRunner(__dirname, 'scenario.ts')
9+
.unignore('client_report')
910
.expect({
1011
client_report: {
1112
discarded_events: [

dev-packages/node-integration-tests/suites/client-reports/periodic-send/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ afterAll(() => {
66

77
test('should flush client reports automatically after the timeout interval', done => {
88
createRunner(__dirname, 'scenario.ts')
9+
.unignore('client_report')
910
.expect({
1011
client_report: {
1112
discarded_events: [

dev-packages/node-integration-tests/suites/tracing/requests/http-unsampled/test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ test('outgoing http requests are correctly instrumented when not sampled', done
2727
.then(([SERVER_URL, closeTestServer]) => {
2828
createRunner(__dirname, 'scenario.ts')
2929
.withEnv({ SERVER_URL })
30-
.ignore('client_report')
3130
.expect({
3231
event: {
3332
exception: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export function createRunner(...paths: string[]) {
152152
let expectedEnvelopeHeaders: ExpectedEnvelopeHeader[] | undefined = undefined;
153153
const flags: string[] = [];
154154
// By default, we ignore session & sessions
155-
const ignored: Set<EnvelopeItemType> = new Set(['session', 'sessions']);
155+
const ignored: Set<EnvelopeItemType> = new Set(['session', 'sessions', 'client_report']);
156156
let withEnv: Record<string, string> = {};
157157
let withSentryServer = false;
158158
let dockerOptions: DockerOptions | undefined;

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
"packages/integration-shims",
6969
"packages/nestjs",
7070
"packages/nextjs",
71-
"packages/nitro-utils",
7271
"packages/node",
7372
"packages/nuxt",
7473
"packages/opentelemetry",

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ interface StartTrackingWebVitalsOptions {
8383
*/
8484
export function startTrackingWebVitals({ recordClsStandaloneSpans }: StartTrackingWebVitalsOptions): () => void {
8585
const performance = getBrowserPerformanceAPI();
86-
if (performance && browserPerformanceTimeOrigin) {
86+
if (performance && browserPerformanceTimeOrigin()) {
8787
// @ts-expect-error we want to make sure all of these are available, even if TS is sure they are
8888
if (performance.mark) {
8989
WINDOW.performance.mark('sentry-tracing-init');
@@ -117,7 +117,7 @@ export function startTrackingLongTasks(): void {
117117
const { op: parentOp, start_timestamp: parentStartTimestamp } = spanToJSON(parent);
118118

119119
for (const entry of entries) {
120-
const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);
120+
const startTime = msToSec((browserPerformanceTimeOrigin() as number) + entry.startTime);
121121
const duration = msToSec(entry.duration);
122122

123123
if (parentOp === 'navigation' && parentStartTimestamp && startTime < parentStartTimestamp) {
@@ -156,7 +156,7 @@ export function startTrackingLongAnimationFrames(): void {
156156
continue;
157157
}
158158

159-
const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);
159+
const startTime = msToSec((browserPerformanceTimeOrigin() as number) + entry.startTime);
160160

161161
const { start_timestamp: parentStartTimestamp, op: parentOp } = spanToJSON(parent);
162162

@@ -167,7 +167,6 @@ export function startTrackingLongAnimationFrames(): void {
167167
// routing instrumentations
168168
continue;
169169
}
170-
171170
const duration = msToSec(entry.duration);
172171

173172
const attributes: SpanAttributes = {
@@ -210,7 +209,7 @@ export function startTrackingInteractions(): void {
210209
}
211210
for (const entry of entries) {
212211
if (entry.name === 'click') {
213-
const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);
212+
const startTime = msToSec((browserPerformanceTimeOrigin() as number) + entry.startTime);
214213
const duration = msToSec(entry.duration);
215214

216215
const spanOptions: StartSpanOptions & Required<Pick<StartSpanOptions, 'attributes'>> = {
@@ -271,7 +270,7 @@ function _trackFID(): () => void {
271270
return;
272271
}
273272

274-
const timeOrigin = msToSec(browserPerformanceTimeOrigin as number);
273+
const timeOrigin = msToSec(browserPerformanceTimeOrigin() as number);
275274
const startTime = msToSec(entry.startTime);
276275
_measurements['fid'] = { value: metric.value, unit: 'millisecond' };
277276
_measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };
@@ -300,12 +299,13 @@ interface AddPerformanceEntriesOptions {
300299
/** Add performance related spans to a transaction */
301300
export function addPerformanceEntries(span: Span, options: AddPerformanceEntriesOptions): void {
302301
const performance = getBrowserPerformanceAPI();
303-
if (!performance?.getEntries || !browserPerformanceTimeOrigin) {
302+
const origin = browserPerformanceTimeOrigin();
303+
if (!performance?.getEntries || !origin) {
304304
// Gatekeeper if performance API not available
305305
return;
306306
}
307307

308-
const timeOrigin = msToSec(browserPerformanceTimeOrigin);
308+
const timeOrigin = msToSec(origin);
309309

310310
const performanceEntries = performance.getEntries();
311311

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function trackClsAsStandaloneSpan(): void {
9090
function sendStandaloneClsSpan(clsValue: number, entry: LayoutShift | undefined, pageloadSpanId: string) {
9191
DEBUG_BUILD && logger.log(`Sending CLS span (${clsValue})`);
9292

93-
const startTime = msToSec((browserPerformanceTimeOrigin || 0) + (entry?.startTime || 0));
93+
const startTime = msToSec((browserPerformanceTimeOrigin() || 0) + (entry?.startTime || 0));
9494
const routeName = getCurrentScope().getScopeData().transactionName;
9595

9696
const name = entry ? htmlTreeAsString(entry.sources[0]?.node) : 'Layout shift';

0 commit comments

Comments
 (0)