Skip to content

Commit 377520a

Browse files
authored
Merge branch 'develop' into sig/http-attributes-fix
2 parents a7304ce + 235c865 commit 377520a

File tree

104 files changed

+5019
-1472
lines changed

Some content is hidden

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

104 files changed

+5019
-1472
lines changed

.size-limit.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = [
3838
path: 'packages/browser/build/npm/esm/prod/index.js',
3939
import: createImport('init', 'browserTracingIntegration'),
4040
gzip: true,
41-
limit: '41.5 KB',
41+
limit: '42 KB',
4242
},
4343
{
4444
name: '@sentry/browser (incl. Tracing, Profiling)',
@@ -127,7 +127,7 @@ module.exports = [
127127
import: createImport('init', 'ErrorBoundary', 'reactRouterV6BrowserTracingIntegration'),
128128
ignore: ['react/jsx-runtime'],
129129
gzip: true,
130-
limit: '43.5 KB',
130+
limit: '44 KB',
131131
},
132132
// Vue SDK (ESM)
133133
{
@@ -142,7 +142,7 @@ module.exports = [
142142
path: 'packages/vue/build/esm/index.js',
143143
import: createImport('init', 'browserTracingIntegration'),
144144
gzip: true,
145-
limit: '43.3 KB',
145+
limit: '44 KB',
146146
},
147147
// Svelte SDK (ESM)
148148
{
@@ -163,7 +163,7 @@ module.exports = [
163163
name: 'CDN Bundle (incl. Tracing)',
164164
path: createCDNPath('bundle.tracing.min.js'),
165165
gzip: true,
166-
limit: '42.1 KB',
166+
limit: '42.5 KB',
167167
},
168168
{
169169
name: 'CDN Bundle (incl. Tracing, Replay)',
@@ -183,14 +183,14 @@ module.exports = [
183183
path: createCDNPath('bundle.min.js'),
184184
gzip: false,
185185
brotli: false,
186-
limit: '80 KB',
186+
limit: '82 KB',
187187
},
188188
{
189189
name: 'CDN Bundle (incl. Tracing) - uncompressed',
190190
path: createCDNPath('bundle.tracing.min.js'),
191191
gzip: false,
192192
brotli: false,
193-
limit: '125 KB',
193+
limit: '127 KB',
194194
},
195195
{
196196
name: 'CDN Bundle (incl. Tracing, Replay) - uncompressed',
@@ -231,7 +231,7 @@ module.exports = [
231231
import: createImport('init'),
232232
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
233233
gzip: true,
234-
limit: '51.1 KB',
234+
limit: '52 KB',
235235
},
236236
// Node SDK (ESM)
237237
{

CHANGELOG.md

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

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

7+
Work in this release was contributed by @bignoncedric and @adam-kov. Thank you for your contributions!
8+
9+
- feat(deps): Bump OpenTelemetry ([#18239](https://github.com/getsentry/sentry-javascript/pull/18239))
10+
- Bump @opentelemetry/context-async-hooks from ^2.1.0 to ^2.2.0
11+
- Bump @opentelemetry/core from ^2.1.0 to ^2.2.0
12+
- Bump @opentelemetry/resources from ^2.1.0 to ^2.2.0
13+
- Bump @opentelemetry/sdk-trace-base from ^2.1.0 to ^2.2.0
14+
- Bump @opentelemetry/sdk-trace-node from ^2.1.0 to ^2.2.0
15+
- Bump @opentelemetry/instrumentation from 0.204.0 to 0.208.0
16+
- Bump @opentelemetry/instrumentation-amqplib from 0.51.0 to 0.55.0
17+
- Bump @opentelemetry/instrumentation-aws-sdk from 0.59.0 to 0.64.0
18+
- Bump @opentelemetry/instrumentation-connect from 0.48.0 to 0.52.0
19+
- Bump @opentelemetry/instrumentation-dataloader from 0.22.0 to 0.26.0
20+
- Bump @opentelemetry/instrumentation-express from 0.53.0 to 0.57.0
21+
- Bump @opentelemetry/instrumentation-fs from 0.24.0 to 0.28.0
22+
- Bump @opentelemetry/instrumentation-generic-pool from 0.48.0 to 0.52.0
23+
- Bump @opentelemetry/instrumentation-graphql from 0.52.0 to 0.56.0
24+
- Bump @opentelemetry/instrumentation-hapi from 0.51.0 to 0.55.0
25+
- Bump @opentelemetry/instrumentation-http from 0.204.0 to 0.208.0
26+
- Bump @opentelemetry/instrumentation-ioredis from 0.52.0 to 0.56.0
27+
- Bump @opentelemetry/instrumentation-kafkajs from 0.14.0 to 0.18.0
28+
- Bump @opentelemetry/instrumentation-knex from 0.49.0 to 0.53.0
29+
- Bump @opentelemetry/instrumentation-koa from 0.52.0 to 0.57.0
30+
- Bump @opentelemetry/instrumentation-lru-memoizer from 0.49.0 to 0.53.0
31+
- Bump @opentelemetry/instrumentation-mongodb from 0.57.0 to 0.61.0
32+
- Bump @opentelemetry/instrumentation-mongoose from 0.51.0 to 0.55.0
33+
- Bump @opentelemetry/instrumentation-mysql from 0.50.0 to 0.54.0
34+
- Bump @opentelemetry/instrumentation-mysql2 from 0.51.0 to 0.55.0
35+
- Bump @opentelemetry/instrumentation-nestjs-core from 0.50.0 to 0.55.0
36+
- Bump @opentelemetry/instrumentation-pg from 0.57.0 to 0.61.0
37+
- Bump @opentelemetry/instrumentation-redis from 0.53.0 to 0.57.0
38+
- Bump @opentelemetry/instrumentation-tedious from 0.23.0 to 0.27.0
39+
- Bump @opentelemetry/instrumentation-undici from 0.15.0 to 0.19.0
40+
- Bump @prisma/instrumentation from 6.15.0 to 6.19.0
41+
742
## 10.26.0
843

944
### Important Changes
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import * as Sentry from '@sentry/browser';
2+
import { browserProfilingIntegration } from '@sentry/browser';
3+
4+
window.Sentry = Sentry;
5+
6+
Sentry.init({
7+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
8+
integrations: [browserProfilingIntegration()],
9+
tracesSampleRate: 1,
10+
profileSessionSampleRate: 1,
11+
profileLifecycle: 'manual',
12+
});
13+
14+
function largeSum(amount = 1000000) {
15+
let sum = 0;
16+
for (let i = 0; i < amount; i++) {
17+
sum += Math.sqrt(i) * Math.sin(i);
18+
}
19+
}
20+
21+
function fibonacci(n) {
22+
if (n <= 1) {
23+
return n;
24+
}
25+
return fibonacci(n - 1) + fibonacci(n - 2);
26+
}
27+
28+
function fibonacci1(n) {
29+
if (n <= 1) {
30+
return n;
31+
}
32+
return fibonacci1(n - 1) + fibonacci1(n - 2);
33+
}
34+
35+
function fibonacci2(n) {
36+
if (n <= 1) {
37+
return n;
38+
}
39+
return fibonacci1(n - 1) + fibonacci1(n - 2);
40+
}
41+
42+
function notProfiledFib(n) {
43+
if (n <= 1) {
44+
return n;
45+
}
46+
return fibonacci1(n - 1) + fibonacci1(n - 2);
47+
}
48+
49+
// Adding setTimeout to ensure we cross the sampling interval to avoid flakes
50+
51+
Sentry.uiProfiler.startProfiler();
52+
53+
fibonacci(40);
54+
await new Promise(resolve => setTimeout(resolve, 25));
55+
56+
largeSum();
57+
await new Promise(resolve => setTimeout(resolve, 25));
58+
59+
Sentry.uiProfiler.stopProfiler();
60+
61+
// ---
62+
63+
notProfiledFib(40);
64+
await new Promise(resolve => setTimeout(resolve, 25));
65+
66+
// ---
67+
68+
Sentry.uiProfiler.startProfiler();
69+
70+
fibonacci2(40);
71+
await new Promise(resolve => setTimeout(resolve, 25));
72+
73+
Sentry.uiProfiler.stopProfiler();
74+
75+
const client = Sentry.getClient();
76+
await client?.flush(8000);
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import { expect } from '@playwright/test';
2+
import type { ProfileChunkEnvelope } from '@sentry/core';
3+
import { sentryTest } from '../../../utils/fixtures';
4+
import {
5+
countEnvelopes,
6+
getMultipleSentryEnvelopeRequests,
7+
properFullEnvelopeRequestParser,
8+
shouldSkipTracingTest,
9+
} from '../../../utils/helpers';
10+
import { validateProfile, validateProfilePayloadMetadata } from '../test-utils';
11+
12+
sentryTest(
13+
'does not send profile envelope when document-policy is not set',
14+
async ({ page, getLocalTestUrl, browserName }) => {
15+
if (shouldSkipTracingTest() || browserName !== 'chromium') {
16+
// Profiling only works when tracing is enabled
17+
sentryTest.skip();
18+
}
19+
20+
const url = await getLocalTestUrl({ testDir: __dirname });
21+
22+
// Assert that no profile_chunk envelope is sent without policy header
23+
const chunkCount = await countEnvelopes(page, { url, envelopeType: 'profile_chunk', timeout: 1500 });
24+
expect(chunkCount).toBe(0);
25+
},
26+
);
27+
28+
sentryTest('sends profile_chunk envelopes in manual mode', async ({ page, getLocalTestUrl, browserName }) => {
29+
if (shouldSkipTracingTest() || browserName !== 'chromium') {
30+
// Profiling only works when tracing is enabled
31+
sentryTest.skip();
32+
}
33+
34+
const url = await getLocalTestUrl({ testDir: __dirname, responseHeaders: { 'Document-Policy': 'js-profiling' } });
35+
36+
// In manual mode we start and stop once -> expect exactly one chunk
37+
const profileChunkEnvelopes = await getMultipleSentryEnvelopeRequests<ProfileChunkEnvelope>(
38+
page,
39+
2,
40+
{ url, envelopeType: 'profile_chunk', timeout: 8000 },
41+
properFullEnvelopeRequestParser,
42+
);
43+
44+
expect(profileChunkEnvelopes.length).toBe(2);
45+
46+
// Validate the first chunk thoroughly
47+
const profileChunkEnvelopeItem = profileChunkEnvelopes[0][1][0];
48+
const envelopeItemHeader = profileChunkEnvelopeItem[0];
49+
const envelopeItemPayload1 = profileChunkEnvelopeItem[1];
50+
51+
expect(envelopeItemHeader).toHaveProperty('type', 'profile_chunk');
52+
expect(envelopeItemPayload1.profile).toBeDefined();
53+
54+
const profilerId1 = envelopeItemPayload1.profiler_id;
55+
56+
validateProfilePayloadMetadata(envelopeItemPayload1);
57+
58+
validateProfile(envelopeItemPayload1.profile, {
59+
expectedFunctionNames: ['startJSSelfProfile', 'fibonacci', 'largeSum'],
60+
minSampleDurationMs: 20,
61+
isChunkFormat: true,
62+
});
63+
64+
// only contains fibonacci
65+
const functionNames1 = envelopeItemPayload1.profile.frames.map(frame => frame.function).filter(name => name !== '');
66+
expect(functionNames1).toEqual(expect.not.arrayContaining(['fibonacci1', 'fibonacci2', 'fibonacci3']));
67+
68+
// === PROFILE CHUNK 2 ===
69+
70+
const profileChunkEnvelopeItem2 = profileChunkEnvelopes[1][1][0];
71+
const envelopeItemHeader2 = profileChunkEnvelopeItem2[0];
72+
const envelopeItemPayload2 = profileChunkEnvelopeItem2[1];
73+
74+
expect(envelopeItemHeader2).toHaveProperty('type', 'profile_chunk');
75+
expect(envelopeItemPayload2.profile).toBeDefined();
76+
77+
expect(envelopeItemPayload2.profiler_id).toBe(profilerId1); // same profiler id for the whole session
78+
79+
validateProfilePayloadMetadata(envelopeItemPayload2);
80+
81+
validateProfile(envelopeItemPayload2.profile, {
82+
expectedFunctionNames: [
83+
'startJSSelfProfile',
84+
'fibonacci1', // called by fibonacci2
85+
'fibonacci2',
86+
],
87+
isChunkFormat: true,
88+
});
89+
90+
// does not contain notProfiledFib (called during unprofiled part)
91+
const functionNames2 = envelopeItemPayload2.profile.frames.map(frame => frame.function).filter(name => name !== '');
92+
expect(functionNames2).toEqual(expect.not.arrayContaining(['notProfiledFib']));
93+
});

dev-packages/browser-integration-tests/suites/profiling/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function validateProfile(
9090
}
9191
}
9292

93-
// Frames
93+
// FRAMES
9494
expect(profile.frames.length).toBeGreaterThan(0);
9595
for (const frame of profile.frames) {
9696
expect(frame).toHaveProperty('function');

dev-packages/browser-integration-tests/suites/public-api/logger/init.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7-
enableLogs: true,
7+
// purposefully testing against the experimental flag here
8+
_experiments: {
9+
enableLogs: true,
10+
},
811
});

dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
77
enableLogs: true,
8+
// Purposefully specifying the experimental flag here
9+
// to ensure the top level option is used instead.
10+
_experiments: {
11+
enableLogs: false,
12+
},
813
integrations: [Sentry.consoleLoggingIntegration()],
914
});

dev-packages/e2e-tests/test-applications/cloudflare-astro/astro.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const dsn = process.env.E2E_TEST_DSN;
66

77
// https://astro.build/config
88
export default defineConfig({
9-
output: 'hybrid',
109
adapter: cloudflare({
1110
imageService: 'passthrough',
1211
}),

dev-packages/e2e-tests/test-applications/cloudflare-astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test:assert": "pnpm -v"
1818
},
1919
"dependencies": {
20-
"@astrojs/cloudflare": "8.1.0",
20+
"@astrojs/cloudflare": "12.6.11",
2121
"@sentry/astro": "latest || *",
2222
"astro": "5.15.9"
2323
},
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
event-dumps
14+
15+
# testing
16+
/coverage
17+
18+
# next.js
19+
/.next/
20+
/out/
21+
22+
# production
23+
/build
24+
25+
# misc
26+
.DS_Store
27+
*.pem
28+
29+
# debug
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
.pnpm-debug.log*
34+
35+
# env files (can opt-in for committing if needed)
36+
.env*
37+
38+
# vercel
39+
.vercel
40+
41+
# typescript
42+
*.tsbuildinfo
43+
next-env.d.ts
44+
45+
# Sentry Config File
46+
.env.sentry-build-plugin

0 commit comments

Comments
 (0)