Skip to content

Commit c1769d6

Browse files
authored
Merge branch 'develop' into timfish/feat/V8-v14-support
2 parents 762af57 + 2af59be commit c1769d6

400 files changed

Lines changed: 13484 additions & 493 deletions

File tree

Some content is hidden

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

.cursor/BUGBOT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ Do not flag the issues below if they appear in tests.
5858
- Flag usage of `expect.objectContaining` and other relaxed assertions, when a test expects something NOT to be included in a payload but there's no respective assertion.
5959
- Flag usage of conditionals in one test and recommend splitting up the test for the different paths.
6060
- Flag usage of loops testing multiple scenarios in one test and recommend using `(it)|(test).each` instead.
61+
- Flag tests that are likely to introduce flakes. In our case this usually means we wait for some telemetry requests sent from an SDK. Patterns to look out for:
62+
- Only waiting for a request, after an action is performed. Instead, start waiting, perform action, await request promise.
63+
- Race conditions when waiting on multiple requests. Ensure that waiting checks are unique enough and don't depend on a hard order when there's a chance that telemetry can be sent in arbitrary order.
64+
- Timeouts or sleeps in tests. Instead suggest concrete events or other signals to wait on.
65+
- Flag usage of `getFirstEnvelope*`, `getMultipleEnvelope*` or related test helpers. These are NOT reliable anymore. Instead suggest helpers like `waitForTransaction`, `waitForError`, `waitForSpans`, etc.
6166

6267
## Platform-safe code
6368

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: '[Flaky CI]: {{ env.JOB_NAME }}'
3+
labels: Tests
4+
---
5+
6+
### Flakiness Type
7+
8+
Other / Unknown
9+
10+
### Name of Job
11+
12+
{{ env.JOB_NAME }}
13+
14+
### Name of Test
15+
16+
_Not available - check the run link for details_
17+
18+
### Link to Test Run
19+
20+
{{ env.RUN_LINK }}
21+
22+
---
23+
24+
_This issue was automatically created._

.github/workflows/build.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,85 @@ jobs:
11921192
# Always run this, even if a dependent job failed
11931193
if: always()
11941194
runs-on: ubuntu-24.04
1195+
permissions:
1196+
issues: write
11951197
steps:
1198+
- name: Check out current commit
1199+
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
1200+
uses: actions/checkout@v6
1201+
with:
1202+
sparse-checkout: .github
1203+
1204+
- name: Create issues for failed jobs
1205+
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
1206+
uses: actions/github-script@v7
1207+
with:
1208+
script: |
1209+
const fs = require('fs');
1210+
1211+
// Fetch actual job details from the API to get descriptive names
1212+
const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, {
1213+
owner: context.repo.owner,
1214+
repo: context.repo.repo,
1215+
run_id: context.runId,
1216+
per_page: 100
1217+
});
1218+
1219+
const failedJobs = jobs.filter(job => job.conclusion === 'failure');
1220+
1221+
if (failedJobs.length === 0) {
1222+
console.log('No failed jobs found');
1223+
return;
1224+
}
1225+
1226+
// Read and parse template
1227+
const template = fs.readFileSync('.github/FLAKY_CI_FAILURE_TEMPLATE.md', 'utf8');
1228+
const [, frontmatter, bodyTemplate] = template.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
1229+
1230+
// Get existing open issues with Tests label
1231+
const existing = await github.paginate(github.rest.issues.listForRepo, {
1232+
owner: context.repo.owner,
1233+
repo: context.repo.repo,
1234+
state: 'open',
1235+
labels: 'Tests',
1236+
per_page: 100
1237+
});
1238+
1239+
for (const job of failedJobs) {
1240+
const jobName = job.name;
1241+
const jobUrl = job.html_url;
1242+
1243+
// Replace template variables
1244+
const vars = {
1245+
'JOB_NAME': jobName,
1246+
'RUN_LINK': jobUrl
1247+
};
1248+
1249+
let title = frontmatter.match(/title:\s*'(.*)'/)[1];
1250+
let issueBody = bodyTemplate;
1251+
for (const [key, value] of Object.entries(vars)) {
1252+
const pattern = new RegExp(`\\{\\{\\s*env\\.${key}\\s*\\}\\}`, 'g');
1253+
title = title.replace(pattern, value);
1254+
issueBody = issueBody.replace(pattern, value);
1255+
}
1256+
1257+
const existingIssue = existing.find(i => i.title === title);
1258+
1259+
if (existingIssue) {
1260+
console.log(`Issue already exists for ${jobName}: #${existingIssue.number}`);
1261+
continue;
1262+
}
1263+
1264+
const newIssue = await github.rest.issues.create({
1265+
owner: context.repo.owner,
1266+
repo: context.repo.repo,
1267+
title: title,
1268+
body: issueBody.trim(),
1269+
labels: ['Tests']
1270+
});
1271+
console.log(`Created issue #${newIssue.data.number} for ${jobName}`);
1272+
}
1273+
11961274
- name: Check for failures
11971275
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
11981276
run: |

.github/workflows/ci-metadata.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ jobs:
5151
id: get_metadata
5252
# We need to try a number of different options for finding the head commit, because each kind of trigger event
5353
# stores it in a different location
54+
env:
55+
COMMIT_SHA_EXPR:
56+
${{ github.event.pull_request.head.sha || github.event.head_commit.id || inputs.head_commit }}
5457
run: |
55-
COMMIT_SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha || github.event.head_commit.id || inputs.head_commit }})
58+
COMMIT_SHA=$(git rev-parse --short "$COMMIT_SHA_EXPR")
5659
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
5760
echo "COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%s $COMMIT_SHA)" >> $GITHUB_ENV
5861

.size-limit.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = [
1515
path: 'packages/browser/build/npm/esm/prod/index.js',
1616
import: createImport('init'),
1717
gzip: true,
18-
limit: '24.5 KB',
18+
limit: '25 KB',
1919
modifyWebpackConfig: function (config) {
2020
const webpack = require('webpack');
2121

@@ -103,7 +103,7 @@ module.exports = [
103103
path: 'packages/browser/build/npm/esm/prod/index.js',
104104
import: createImport('init', 'sendFeedback'),
105105
gzip: true,
106-
limit: '31 KB',
106+
limit: '32 KB',
107107
},
108108
{
109109
name: '@sentry/browser (incl. FeedbackAsync)',
@@ -117,7 +117,7 @@ module.exports = [
117117
path: 'packages/browser/build/npm/esm/prod/index.js',
118118
import: createImport('init', 'metrics'),
119119
gzip: true,
120-
limit: '27 KB',
120+
limit: '28 KB',
121121
},
122122
{
123123
name: '@sentry/browser (incl. Logs)',
@@ -148,7 +148,7 @@ module.exports = [
148148
import: createImport('init', 'ErrorBoundary', 'reactRouterV6BrowserTracingIntegration'),
149149
ignore: ['react/jsx-runtime'],
150150
gzip: true,
151-
limit: '45.1 KB',
151+
limit: '46 KB',
152152
},
153153
// Vue SDK (ESM)
154154
{
@@ -220,13 +220,13 @@ module.exports = [
220220
name: 'CDN Bundle (incl. Tracing, Replay, Feedback)',
221221
path: createCDNPath('bundle.tracing.replay.feedback.min.js'),
222222
gzip: true,
223-
limit: '86 KB',
223+
limit: '87 KB',
224224
},
225225
{
226226
name: 'CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)',
227227
path: createCDNPath('bundle.tracing.replay.feedback.logs.metrics.min.js'),
228228
gzip: true,
229-
limit: '87 KB',
229+
limit: '88 KB',
230230
},
231231
// browser CDN bundles (non-gzipped)
232232
{
@@ -241,7 +241,7 @@ module.exports = [
241241
path: createCDNPath('bundle.tracing.min.js'),
242242
gzip: false,
243243
brotli: false,
244-
limit: '129 KB',
244+
limit: '130 KB',
245245
},
246246
{
247247
name: 'CDN Bundle (incl. Logs, Metrics) - uncompressed',
@@ -255,7 +255,7 @@ module.exports = [
255255
path: createCDNPath('bundle.tracing.logs.metrics.min.js'),
256256
gzip: false,
257257
brotli: false,
258-
limit: '132 KB',
258+
limit: '134 KB',
259259
},
260260
{
261261
name: 'CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed',
@@ -269,14 +269,14 @@ module.exports = [
269269
path: createCDNPath('bundle.tracing.replay.min.js'),
270270
gzip: false,
271271
brotli: false,
272-
limit: '246 KB',
272+
limit: '247 KB',
273273
},
274274
{
275275
name: 'CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed',
276276
path: createCDNPath('bundle.tracing.replay.logs.metrics.min.js'),
277277
gzip: false,
278278
brotli: false,
279-
limit: '250 KB',
279+
limit: '251 KB',
280280
},
281281
{
282282
name: 'CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed',
@@ -317,7 +317,7 @@ module.exports = [
317317
import: createImport('init'),
318318
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
319319
gzip: true,
320-
limit: '57 KB',
320+
limit: '59 KB',
321321
},
322322
// Node SDK (ESM)
323323
{
@@ -326,14 +326,14 @@ module.exports = [
326326
import: createImport('init'),
327327
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
328328
gzip: true,
329-
limit: '176 KB',
329+
limit: '177 KB',
330330
},
331331
{
332332
name: '@sentry/node - without tracing',
333333
path: 'packages/node/build/esm/index.js',
334334
import: createImport('initWithoutDefaultIntegrations', 'getDefaultIntegrationsWithoutPerformance'),
335335
gzip: true,
336-
limit: '98 KB',
336+
limit: '100 KB',
337337
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
338338
modifyWebpackConfig: function (config) {
339339
const webpack = require('webpack');
@@ -356,7 +356,7 @@ module.exports = [
356356
import: createImport('init'),
357357
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
358358
gzip: true,
359-
limit: '114 KB',
359+
limit: '117 KB',
360360
},
361361
];
362362

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"_comment": "Auto-generated by scripts/bump-version.js. Used by the gitflow sync workflow to detect version bumps. Do not edit manually.",
3-
"version": "10.47.0"
3+
"version": "10.48.0"
44
}

CHANGELOG.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,29 @@
22

33
## Unreleased
44

5-
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
5+
## 10.48.0
6+
7+
### Important Changes
8+
9+
- **feat(aws-serverless): Ship Lambda extension in npm package for container image Lambdas ([#20133](https://github.com/getsentry/sentry-javascript/pull/20133))**
10+
11+
The Sentry Lambda extension is now included in the npm package, enabling container image-based Lambda functions to use it. Copy the extension files into your Docker image and set the `tunnel` option:
12+
13+
```dockerfile
14+
RUN mkdir -p /opt/sentry-extension
15+
COPY node_modules/@sentry/aws-serverless/build/lambda-extension/sentry-extension /opt/extensions/sentry-extension
16+
COPY node_modules/@sentry/aws-serverless/build/lambda-extension/index.mjs /opt/sentry-extension/index.mjs
17+
RUN chmod +x /opt/extensions/sentry-extension /opt/sentry-extension/index.mjs
18+
```
19+
20+
```js
21+
Sentry.init({
22+
dsn: '__DSN__',
23+
tunnel: 'http://localhost:9000/envelope',
24+
});
25+
```
26+
27+
This works with any Sentry SDK (`@sentry/aws-serverless`, `@sentry/sveltekit`, `@sentry/node`, etc.).
628

729
- **feat(cloudflare): Support basic WorkerEntrypoint ([#19884](https://github.com/getsentry/sentry-javascript/pull/19884))**
830

@@ -40,7 +62,7 @@
4062

4163
If you reference these attributes in hooks (e.g. `beforeSendTransaction`), update them to the `gen_ai.*` equivalents.
4264

43-
- feat(langchain): Support embeddings APIs in LangChain ([#20017](https://github.com/getsentry/sentry-javascript/pull/20017))
65+
- **feat(core): Support embeddings in LangChain ([#20017](https://github.com/getsentry/sentry-javascript/pull/20017))**
4466

4567
Adds instrumentation for LangChain embeddings (`embedQuery`, `embedDocuments`), creating `gen_ai.embeddings` spans. In Node.js, embedding classes from `@langchain/openai`, `@langchain/google-genai`, `@langchain/mistralai`, and `@langchain/google-vertexai` are auto-instrumented. For other runtimes, use the new `instrumentLangChainEmbeddings` API:
4668

@@ -53,6 +75,43 @@
5375
await embeddings.embedQuery('Hello world');
5476
```
5577

78+
### Other Changes
79+
80+
- feat(core): Support registerTool/registerResource/registerPrompt in MCP integration ([#20071](https://github.com/getsentry/sentry-javascript/pull/20071))
81+
- feat(core, node): Portable Express integration ([#19928](https://github.com/getsentry/sentry-javascript/pull/19928))
82+
- feat(deno): Add `denoRuntimeMetricsIntegration` ([#20023](https://github.com/getsentry/sentry-javascript/pull/20023))
83+
- feat(deps): Bump bundler plugins to `5.2.0` ([#20122](https://github.com/getsentry/sentry-javascript/pull/20122))
84+
- feat(deps): bump @hapi/content from 6.0.0 to 6.0.1 ([#20102](https://github.com/getsentry/sentry-javascript/pull/20102))
85+
- feat(node, bun): Enforce minimum collection interval in runtime metrics integrations ([#20068](https://github.com/getsentry/sentry-javascript/pull/20068))
86+
- feat(nuxt): Exclude tracing meta tags on cached pages in Nuxt 5 ([#20168](https://github.com/getsentry/sentry-javascript/pull/20168))
87+
- feat(react-router): Export `sentryOnError` ([#20120](https://github.com/getsentry/sentry-javascript/pull/20120))
88+
- fix(aws-serverless): Add timeout to \_endSpan forceFlush to prevent Lambda hanging ([#20064](https://github.com/getsentry/sentry-javascript/pull/20064))
89+
- fix(cloudflare): Ensure every request instruments functions ([#20044](https://github.com/getsentry/sentry-javascript/pull/20044))
90+
- fix(core): Only attach `flags` context to error events ([#20116](https://github.com/getsentry/sentry-javascript/pull/20116))
91+
- fix(core): Replace regex with string check in stack parser to prevent main thread blocking ([#20089](https://github.com/getsentry/sentry-javascript/pull/20089))
92+
- fix(core): set span.status to error when MCP tool returns JSON-RPC error response ([#20082](https://github.com/getsentry/sentry-javascript/pull/20082))
93+
- fix(gatsby): Fix errorHandler signature to match bundler-plugin-core API ([#20048](https://github.com/getsentry/sentry-javascript/pull/20048))
94+
- ref(core): Do not emit spans for chats.create in google-genai ([#19990](https://github.com/getsentry/sentry-javascript/pull/19990))
95+
96+
<details>
97+
<summary> <strong>Internal Changes</strong> </summary>
98+
99+
- chore: Remove unused `tsconfig-template` folder ([#20067](https://github.com/getsentry/sentry-javascript/pull/20067))
100+
- chore: Update validate-pr workflow ([#20072](https://github.com/getsentry/sentry-javascript/pull/20072))
101+
- chore(deps-dev): Bump effect from 3.20.0 to 3.21.0 ([#19999](https://github.com/getsentry/sentry-javascript/pull/19999))
102+
- chore(deps): Bump @xmldom/xmldom from 0.8.3 to 0.8.12 ([#20066](https://github.com/getsentry/sentry-javascript/pull/20066))
103+
- chore(deps): Bump lodash.template from 4.5.0 to 4.18.1 ([#20085](https://github.com/getsentry/sentry-javascript/pull/20085))
104+
- chore(oxlint): Add typeawareness into oxlintrc ([#20075](https://github.com/getsentry/sentry-javascript/pull/20075))
105+
- ci(deps): Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.24.1 to 2.25.2 ([#20081](https://github.com/getsentry/sentry-javascript/pull/20081))
106+
- ci(deps): Bump `mshick/add-pr-comment` ([#20078](https://github.com/getsentry/sentry-javascript/pull/20078))
107+
- ref(core): Extract shared endStreamSpan for AI integrations ([#20021](https://github.com/getsentry/sentry-javascript/pull/20021))
108+
- ref(core): Simplify addResponseAttributes in openai integration ([#20013](https://github.com/getsentry/sentry-javascript/pull/20013))
109+
- test(angular): Bump TypeScript to ~6.0.0 in angular-21 E2E test app ([#20134](https://github.com/getsentry/sentry-javascript/pull/20134))
110+
- test(nuxt): Make Nuxt 5 (nightly) E2E optional ([#20113](https://github.com/getsentry/sentry-javascript/pull/20113))
111+
- tests(node): Add node integration tests for Vercel `ToolLoopAgent` ([#20087](https://github.com/getsentry/sentry-javascript/pull/20087))
112+
113+
</details>
114+
56115
## 10.47.0
57116

58117
### Important Changes

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "10.47.0",
3+
"version": "10.48.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -60,9 +60,9 @@
6060
"@babel/preset-typescript": "^7.16.7",
6161
"@playwright/test": "~1.56.0",
6262
"@sentry-internal/rrweb": "2.34.0",
63-
"@sentry/browser": "10.47.0",
63+
"@sentry/browser": "10.48.0",
6464
"@supabase/supabase-js": "2.49.3",
65-
"axios": "1.13.5",
65+
"axios": "1.15.0",
6666
"babel-loader": "^10.1.1",
6767
"fflate": "0.8.2",
6868
"html-webpack-plugin": "^5.5.0",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7+
integrations: [Sentry.browserTracingIntegration(), Sentry.spanStreamingIntegration()],
8+
tracesSampleRate: 1,
9+
beforeSendSpan: Sentry.withStreamedSpan(span => {
10+
if (span.attributes['sentry.op'] === 'pageload') {
11+
span.name = 'customPageloadSpanName';
12+
span.links = [
13+
{
14+
context: {
15+
traceId: '123',
16+
spanId: '456',
17+
},
18+
attributes: {
19+
'sentry.link.type': 'custom_link',
20+
},
21+
},
22+
];
23+
span.attributes['sentry.custom_attribute'] = 'customAttributeValue';
24+
span.status = 'something';
25+
}
26+
return span;
27+
}),
28+
});

0 commit comments

Comments
 (0)