Skip to content

[Gitflow] Merge master into develop #16696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@

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

## 9.31.0

### Important Changes

- feat(nextjs): Add option for auto-generated random tunnel route ([#16626](https://github.com/getsentry/sentry-javascript/pull/16626))

Adds an option to automatically generate a random tunnel route for the Next.js SDK. This helps prevent ad blockers and other tools from blocking Sentry requests by using a randomized path instead of the predictable `/monitoring` endpoint.

- feat(core): Allow to pass `scope` & `client` to `getTraceData` ([#16633](https://github.com/getsentry/sentry-javascript/pull/16633))

Adds the ability to pass custom `scope` and `client` parameters to the `getTraceData` function, providing more flexibility when generating trace data for distributed tracing.

### Other Changes

- feat(core): Add support for `x-forwarded-host` and `x-forwarded-proto` headers ([#16687](https://github.com/getsentry/sentry-javascript/pull/16687))
- deps: Remove unused `@sentry/opentelemetry` dependency ([#16677](https://github.com/getsentry/sentry-javascript/pull/16677))
- deps: Update all bundler plugin instances to latest & allow caret ranges ([#16641](https://github.com/getsentry/sentry-javascript/pull/16641))
- feat(deps): Bump @prisma/instrumentation from 6.8.2 to 6.9.0 ([#16608](https://github.com/getsentry/sentry-javascript/pull/16608))
- feat(flags): add node support for generic featureFlagsIntegration and move utils to core ([#16585](https://github.com/getsentry/sentry-javascript/pull/16585))
- feat(flags): capture feature flag evaluations on spans ([#16485](https://github.com/getsentry/sentry-javascript/pull/16485))
- feat(pino): Add initial package for `@sentry/pino-transport` ([#16652](https://github.com/getsentry/sentry-javascript/pull/16652))
- fix: Wait for the correct clientWidth/clientHeight when showing Feedback Screenshot previews ([#16648](https://github.com/getsentry/sentry-javascript/pull/16648))
- fix(browser): Remove usage of Array.at() method ([#16647](https://github.com/getsentry/sentry-javascript/pull/16647))
- fix(core): Improve `safeJoin` usage in console logging integration ([#16658](https://github.com/getsentry/sentry-javascript/pull/16658))
- fix(google-cloud-serverless): Make `CloudEvent` type compatible ([#16661](https://github.com/getsentry/sentry-javascript/pull/16661))
- fix(nextjs): Fix lookup of `instrumentation-client.js` file ([#16637](https://github.com/getsentry/sentry-javascript/pull/16637))
- fix(node): Ensure graphql errors result in errored spans ([#16678](https://github.com/getsentry/sentry-javascript/pull/16678))

## 9.30.0

- feat(nextjs): Add URL to tags of server components and generation functions issues ([#16500](https://github.com/getsentry/sentry-javascript/pull/16500))
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-integration-tests",
"version": "9.30.0",
"version": "9.31.0",
"main": "index.js",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -42,7 +42,7 @@
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "~1.50.0",
"@sentry-internal/rrweb": "2.34.0",
"@sentry/browser": "9.30.0",
"@sentry/browser": "9.31.0",
"@supabase/supabase-js": "2.49.3",
"axios": "1.8.2",
"babel-loader": "^8.2.2",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/bundle-analyzer-scenarios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/bundle-analyzer-scenarios",
"version": "9.30.0",
"version": "9.31.0",
"description": "Scenarios to test bundle analysis with",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/clear-cache-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/clear-cache-gh-action",
"description": "An internal Github Action to clear GitHub caches.",
"version": "9.30.0",
"version": "9.31.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/e2e-tests",
"version": "9.30.0",
"version": "9.31.0",
"license": "MIT",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/external-contributor-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/external-contributor-gh-action",
"description": "An internal Github Action to add external contributors to the CHANGELOG.md file.",
"version": "9.30.0",
"version": "9.31.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
8 changes: 4 additions & 4 deletions dev-packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/node-integration-tests",
"version": "9.30.0",
"version": "9.31.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down Expand Up @@ -30,9 +30,9 @@
"@nestjs/common": "11.0.16",
"@nestjs/core": "10.4.6",
"@nestjs/platform-express": "10.4.6",
"@sentry/aws-serverless": "9.30.0",
"@sentry/core": "9.30.0",
"@sentry/node": "9.30.0",
"@sentry/aws-serverless": "9.31.0",
"@sentry/core": "9.31.0",
"@sentry/node": "9.31.0",
"@types/mongodb": "^3.6.20",
"@types/mysql": "^2.15.21",
"@types/pg": "^8.6.5",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/opentelemetry-v2-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/opentelemetry-v2-tests",
"version": "9.30.0",
"version": "9.31.0",
"private": true,
"description": "Tests for @sentry/opentelemetry with OpenTelemetry v2",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/rollup-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/rollup-utils",
"version": "9.30.0",
"version": "9.31.0",
"description": "Rollup utilities used at Sentry for the Sentry JavaScript SDK",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/rollup-utils",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/size-limit-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/size-limit-gh-action",
"description": "An internal Github Action to compare the current size of a PR against the one on develop.",
"version": "9.30.0",
"version": "9.31.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "9.30.0",
"version": "9.31.0",
"name": "@sentry-internal/test-utils",
"author": "Sentry",
"license": "MIT",
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"devDependencies": {
"@playwright/test": "~1.50.0",
"@sentry/core": "9.30.0"
"@sentry/core": "9.31.0"
},
"volta": {
"extends": "../../package.json"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "9.30.0",
"version": "9.31.0",
"npmClient": "yarn"
}
6 changes: 3 additions & 3 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular",
"version": "9.30.0",
"version": "9.31.0",
"description": "Official Sentry SDK for Angular",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
Expand All @@ -21,8 +21,8 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "9.30.0",
"@sentry/core": "9.30.0",
"@sentry/browser": "9.31.0",
"@sentry/core": "9.31.0",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/astro",
"version": "9.30.0",
"version": "9.31.0",
"description": "Official Sentry SDK for Astro",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/astro",
Expand Down Expand Up @@ -56,9 +56,9 @@
"astro": ">=3.x || >=4.0.0-beta || >=5.x"
},
"dependencies": {
"@sentry/browser": "9.30.0",
"@sentry/core": "9.30.0",
"@sentry/node": "9.30.0",
"@sentry/browser": "9.31.0",
"@sentry/core": "9.31.0",
"@sentry/node": "9.31.0",
"@sentry/vite-plugin": "^2.22.6"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-serverless/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/aws-serverless",
"version": "9.30.0",
"version": "9.31.0",
"description": "Official Sentry SDK for AWS Lambda and AWS Serverless Environments",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/serverless",
Expand Down Expand Up @@ -68,8 +68,8 @@
"@opentelemetry/instrumentation": "^0.57.2",
"@opentelemetry/instrumentation-aws-lambda": "0.50.3",
"@opentelemetry/instrumentation-aws-sdk": "0.49.1",
"@sentry/core": "9.30.0",
"@sentry/node": "9.30.0",
"@sentry/core": "9.31.0",
"@sentry/node": "9.31.0",
"@types/aws-lambda": "^8.10.62"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/browser-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-utils",
"version": "9.30.0",
"version": "9.31.0",
"description": "Browser Utilities for all Sentry JavaScript SDKs",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser-utils",
Expand Down Expand Up @@ -39,7 +39,7 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "9.30.0"
"@sentry/core": "9.31.0"
},
"scripts": {
"build": "run-p build:transpile build:types",
Expand Down
14 changes: 7 additions & 7 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/browser",
"version": "9.30.0",
"version": "9.31.0",
"description": "Official Sentry SDK for browsers",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
Expand Down Expand Up @@ -39,14 +39,14 @@
"access": "public"
},
"dependencies": {
"@sentry-internal/browser-utils": "9.30.0",
"@sentry-internal/feedback": "9.30.0",
"@sentry-internal/replay": "9.30.0",
"@sentry-internal/replay-canvas": "9.30.0",
"@sentry/core": "9.30.0"
"@sentry-internal/browser-utils": "9.31.0",
"@sentry-internal/feedback": "9.31.0",
"@sentry-internal/replay": "9.31.0",
"@sentry-internal/replay-canvas": "9.31.0",
"@sentry/core": "9.31.0"
},
"devDependencies": {
"@sentry-internal/integration-shims": "9.30.0",
"@sentry-internal/integration-shims": "9.31.0",
"fake-indexeddb": "^4.0.1"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions packages/bun/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/bun",
"version": "9.30.0",
"version": "9.31.0",
"description": "Official Sentry SDK for bun",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/bun",
Expand Down Expand Up @@ -39,8 +39,8 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "9.30.0",
"@sentry/node": "9.30.0"
"@sentry/core": "9.31.0",
"@sentry/node": "9.31.0"
},
"devDependencies": {
"bun-types": "^1.2.9"
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/cloudflare",
"version": "9.30.0",
"version": "9.31.0",
"description": "Official Sentry SDK for Cloudflare Workers and Pages",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/cloudflare",
Expand Down Expand Up @@ -49,7 +49,7 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "9.30.0"
"@sentry/core": "9.31.0"
},
"peerDependencies": {
"@cloudflare/workers-types": "^4.x"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/core",
"version": "9.30.0",
"version": "9.31.0",
"description": "Base implementation for all Sentry JavaScript SDKs",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
Expand Down
11 changes: 9 additions & 2 deletions packages/core/src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,15 @@ export function httpRequestToRequestData(request: {
};
}): RequestEventData {
const headers = request.headers || {};
const host = typeof headers.host === 'string' ? headers.host : undefined;
const protocol = request.protocol || (request.socket?.encrypted ? 'https' : 'http');

// Check for x-forwarded-host first, then fall back to host header
const forwardedHost = typeof headers['x-forwarded-host'] === 'string' ? headers['x-forwarded-host'] : undefined;
const host = forwardedHost || (typeof headers.host === 'string' ? headers.host : undefined);

// Check for x-forwarded-proto first, then fall back to existing protocol detection
const forwardedProto = typeof headers['x-forwarded-proto'] === 'string' ? headers['x-forwarded-proto'] : undefined;
const protocol = forwardedProto || request.protocol || (request.socket?.encrypted ? 'https' : 'http');

const url = request.url || '';

const absoluteUrl = getAbsoluteUrl({
Expand Down
Loading
Loading