Skip to content

Commit 89a8963

Browse files
authored
Merge branch 'develop' into lforst-rm-autoinstrremix
2 parents e1bf630 + 03e0d02 commit 89a8963

File tree

42 files changed

+629
-3096
lines changed

Some content is hidden

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

42 files changed

+629
-3096
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ jobs:
747747
run: yarn test
748748

749749
job_remix_integration_tests:
750-
name: Remix v${{ matrix.remix }} (Node ${{ matrix.node }}) Tests
750+
name: Remix (Node ${{ matrix.node }}) Tests
751751
needs: [job_get_metadata, job_build]
752752
if: needs.job_build.outputs.changed_remix == 'true' || github.event_name != 'pull_request'
753753
runs-on: ubuntu-20.04

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

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

13-
Work in this release was contributed by @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, and @kunal-511. Thank you for your contributions!
13+
Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, and @kunal-511. Thank you for your contributions!
1414

1515
- **feat(solidstart)!: Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))**
1616

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"@sentry/browser": "8.45.0",
4747
"axios": "1.7.7",
4848
"babel-loader": "^8.2.2",
49-
"html-webpack-plugin": "^5.5.0",
5049
"fflate": "0.8.2",
50+
"html-webpack-plugin": "^5.5.0",
5151
"webpack": "^5.95.0"
5252
},
5353
"devDependencies": {

dev-packages/e2e-tests/test-applications/create-remix-app-express-legacy/app/entry.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ installGlobals();
1313

1414
const ABORT_DELAY = 5_000;
1515

16-
export const handleError = Sentry.wrapRemixHandleError;
16+
export const handleError = Sentry.sentryHandleError;
1717

1818
export default function handleRequest(
1919
request: Request,

dev-packages/e2e-tests/test-applications/create-remix-app-express-vite-dev/app/entry.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ installGlobals();
1313

1414
const ABORT_DELAY = 5_000;
1515

16-
export const handleError = Sentry.wrapRemixHandleError;
16+
export const handleError = Sentry.sentryHandleError;
1717

1818
export default function handleRequest(
1919
request: Request,

dev-packages/e2e-tests/test-applications/create-remix-app-express/app/entry.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ installGlobals();
1313

1414
const ABORT_DELAY = 5_000;
1515

16-
export const handleError = Sentry.wrapRemixHandleError;
16+
export const handleError = Sentry.sentryHandleError;
1717

1818
export default function handleRequest(
1919
request: Request,

dev-packages/e2e-tests/test-applications/nestjs-fastify/src/app.controller.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Controller, Get, Param, ParseIntPipe, UseFilters, UseGuards, UseInterceptors } from '@nestjs/common';
1+
import { All, Controller, Get, Param, ParseIntPipe, UseFilters, UseGuards, UseInterceptors } from '@nestjs/common';
22
import { flush } from '@sentry/nestjs';
33
import { AppService } from './app.service';
44
import { AsyncInterceptor } from './async-example.interceptor';
@@ -121,4 +121,9 @@ export class AppController {
121121
testFunctionName() {
122122
return this.appService.getFunctionName();
123123
}
124+
125+
@All('test-all')
126+
testAll() {
127+
return {};
128+
}
124129
}

dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,3 +808,8 @@ test('Calling canActivate method on service with Injectable decorator returns 20
808808
const response = await fetch(`${baseURL}/test-service-canActivate`);
809809
expect(response.status).toBe(200);
810810
});
811+
812+
test('Calling @All method on service with Injectable decorator returns 200', async ({ baseURL }) => {
813+
const response = await fetch(`${baseURL}/test-all`);
814+
expect(response.status).toBe(200);
815+
});

dev-packages/node-integration-tests/scripts/use-ts-3_8.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
/* eslint-disable no-console */
22
const { execSync } = require('child_process');
33
const { join } = require('path');
4-
const { writeFileSync } = require('fs');
4+
const { readFileSync, writeFileSync } = require('fs');
55

66
const cwd = join(__dirname, '../../..');
77

8+
// Newer versions of the Express types use syntax that isn't supported by TypeScript 3.8.
9+
// We'll pin to the last version of those types that are compatible.
10+
console.log('Pinning Express types to old versions...');
11+
12+
const packageJsonPath = join(cwd, 'package.json');
13+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
14+
15+
if (!packageJson.resolutions) packageJson.resolutions = {};
16+
packageJson.resolutions['@types/express'] = '4.17.13';
17+
packageJson.resolutions['@types/express-serve-static-core'] = '4.17.30';
18+
19+
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
20+
821
const tsVersion = '3.8';
922

1023
console.log(`Installing typescript@${tsVersion}, and @types/node@14...`);
@@ -20,7 +33,7 @@ const baseTscConfigPath = join(cwd, 'packages/typescript/tsconfig.json');
2033

2134
const tsConfig = require(baseTscConfigPath);
2235

23-
// TS 3.8 fails build when it encounteres a config option it does not understand, so we remove it :(
36+
// TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :(
2437
delete tsConfig.compilerOptions.noUncheckedIndexedAccess;
2538

2639
writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2));

docs/migration/v8-to-v9.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ We no longer test against Node 14 and Node 16 and cannot guarantee that the SDK
3838

3939
If you need to support older browsers, we recommend transpiling your code using Babel or similar tooling.
4040

41+
**Deno:** The minimum supported Deno version is now **2.0.0**.
42+
4143
### Framework Support Changes
4244

4345
Support for the following Framework versions is dropped:
@@ -271,6 +273,8 @@ Let us know if this is causing issues in your setup by opening an issue on GitHu
271273

272274
### `@sentry/deno`
273275

276+
The minimum supported Deno version is now **2.0.0**.
277+
274278
- `@sentry/deno` is no longer published on `deno.land` so you'll need to import
275279
from npm:
276280

@@ -345,6 +349,7 @@ The `enableTracing` option was removed. In v9, to emulate `enableTracing: true`,
345349
To enable session tracking, it is recommended to unset `autoSessionTracking` and ensure that either, in browser environments the `browserSessionIntegration` is added, or in server environments the `httpIntegration` is added.
346350

347351
To disable session tracking, it is recommended unset `autoSessionTracking` and to remove the `browserSessionIntegration` in browser environments, or in server environments configure the `httpIntegration` with the `trackIncomingRequestsAsSessions` option set to `false`.
352+
Additionally, in Node.js environments, a session was automatically created for every node process when `autoSessionTracking` was set to `true`. This behavior has been replaced by the `processSessionIntegration` which is configured by default.
348353

349354
- **The metrics API has been removed from the SDK.**
350355

packages/aws-serverless/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
},
6666
"dependencies": {
6767
"@opentelemetry/api": "^1.9.0",
68-
"@opentelemetry/instrumentation": "^0.56.0",
69-
"@opentelemetry/instrumentation-aws-lambda": "0.50.0",
70-
"@opentelemetry/instrumentation-aws-sdk": "0.48.0",
68+
"@opentelemetry/instrumentation": "^0.57.1",
69+
"@opentelemetry/instrumentation-aws-lambda": "0.50.2",
70+
"@opentelemetry/instrumentation-aws-sdk": "0.49.0",
7171
"@sentry/core": "8.45.0",
7272
"@sentry/node": "8.45.0",
7373
"@types/aws-lambda": "^8.10.62"

packages/browser-utils/src/metrics/web-vitals/types/base.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,6 @@ export type MetricWithAttribution =
104104
*/
105105
export type MetricRatingThresholds = [number, number];
106106

107-
/**
108-
* @deprecated Use metric-specific function types instead, such as:
109-
* `(metric: LCPMetric) => void`. If a single callback type is needed for
110-
* multiple metrics, use `(metric: MetricType) => void`.
111-
*/
112-
export interface ReportCallback {
113-
(metric: MetricType): void;
114-
}
115-
116107
export interface ReportOpts {
117108
reportAllChanges?: boolean;
118109
durationThreshold?: number;

packages/browser/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export {
3939
} from './tracing/browserTracingIntegration';
4040
export type { RequestInstrumentationOptions } from './tracing/request';
4141
export {
42-
// eslint-disable-next-line deprecation/deprecation
43-
addTracingExtensions,
4442
registerSpanErrorInstrumentation,
4543
getActiveSpan,
4644
getRootSpan,

packages/core/src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
758758

759759
/** Updates existing session based on the provided event */
760760
protected _updateSessionFromEvent(session: Session, event: Event): void {
761-
let crashed = false;
761+
let crashed = event.level === 'fatal';
762762
let errored = false;
763763
const exceptions = event.exception?.values;
764764

@@ -1111,11 +1111,13 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
11111111
/**
11121112
* @deprecated Use `Client` instead. This alias may be removed in a future major version.
11131113
*/
1114+
// TODO(v10): Remove
11141115
export type BaseClient = Client;
11151116

11161117
/**
11171118
* @deprecated Use `Client` instead. This alias may be removed in a future major version.
11181119
*/
1120+
// TODO(v10): Remove
11191121
export const BaseClient = Client;
11201122

11211123
/**

packages/core/src/fetch.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { Client } from './client';
2-
import type { Scope } from './scope';
31
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes';
42
import { SPAN_STATUS_ERROR, setHttpStatus, startInactiveSpan } from './tracing';
53
import { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan';
@@ -201,27 +199,6 @@ function _addTracingHeadersToFetchRequest(
201199
}
202200
}
203201

204-
/**
205-
* Adds sentry-trace and baggage headers to the various forms of fetch headers.
206-
*
207-
* @deprecated This function will not be exported anymore in v9.
208-
*/
209-
export function addTracingHeadersToFetchRequest(
210-
request: string | unknown,
211-
_client: Client | undefined,
212-
_scope: Scope | undefined,
213-
fetchOptionsObj: {
214-
headers?:
215-
| {
216-
[key: string]: string[] | string | undefined;
217-
}
218-
| PolymorphicRequestHeaders;
219-
},
220-
span?: Span,
221-
): PolymorphicRequestHeaders | undefined {
222-
return _addTracingHeadersToFetchRequest(request as Request, fetchOptionsObj, span);
223-
}
224-
225202
function getFullURL(url: string): string | undefined {
226203
try {
227204
const parsed = new URL(url);

packages/core/src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,7 @@ export { rewriteFramesIntegration } from './integrations/rewriteframes';
110110
export { zodErrorsIntegration } from './integrations/zoderrors';
111111
export { thirdPartyErrorFilterIntegration } from './integrations/third-party-errors-filter';
112112
export { profiler } from './profiling';
113-
export {
114-
// eslint-disable-next-line deprecation/deprecation
115-
addTracingHeadersToFetchRequest,
116-
instrumentFetchRequest,
117-
} from './fetch';
113+
export { instrumentFetchRequest } from './fetch';
118114
export { trpcMiddleware } from './trpc';
119115
export { captureFeedback } from './feedback';
120116
export type { ReportDialogOptions } from './report-dialog';

packages/core/src/tracing/hubextensions.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/core/src/tracing/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
export { registerSpanErrorInstrumentation } from './errors';
22
export { setCapturedScopesOnSpan, getCapturedScopesOnSpan } from './utils';
3-
// eslint-disable-next-line deprecation/deprecation
4-
export { addTracingExtensions } from './hubextensions';
53
export { startIdleSpan, TRACING_DEFAULTS } from './idleSpan';
64
export { SentrySpan } from './sentrySpan';
75
export { SentryNonRecordingSpan } from './sentryNonRecordingSpan';

packages/core/src/utils-hoist/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ export {
4747
parseSemver,
4848
uuid4,
4949
} from './misc';
50-
// eslint-disable-next-line deprecation/deprecation
51-
export { dynamicRequire, isNodeEnv, loadModule } from './node';
50+
export { isNodeEnv, loadModule } from './node';
5251
export { normalize, normalizeToSize, normalizeUrlToBase } from './normalize';
5352
export {
5453
addNonEnumerableProperty,
@@ -136,8 +135,6 @@ export { eventFromMessage, eventFromUnknownInput, exceptionFromError, parseStack
136135
export { callFrameToStackFrame, watchdogTimer } from './anr';
137136
export { LRUMap } from './lru';
138137
export {
139-
// eslint-disable-next-line deprecation/deprecation
140-
generatePropagationContext,
141138
generateTraceId,
142139
generateSpanId,
143140
} from './propagationContext';

packages/core/src/utils-hoist/node.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ export function isNodeEnv(): boolean {
2323
* Requires a module which is protected against bundler minification.
2424
*
2525
* @param request The module path to resolve
26-
* @deprecated This function will be removed in the next major version.
2726
*/
2827
// eslint-disable-next-line @typescript-eslint/no-explicit-any
29-
export function dynamicRequire(mod: any, request: string): any {
28+
function dynamicRequire(mod: any, request: string): any {
3029
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3130
return mod.require(request);
3231
}
@@ -48,17 +47,14 @@ export function loadModule<T>(moduleName: string): T | undefined {
4847
let mod: T | undefined;
4948

5049
try {
51-
// eslint-disable-next-line deprecation/deprecation
5250
mod = dynamicRequire(module, moduleName);
5351
} catch (e) {
5452
// no-empty
5553
}
5654

5755
if (!mod) {
5856
try {
59-
// eslint-disable-next-line deprecation/deprecation
6057
const { cwd } = dynamicRequire(module, 'process');
61-
// eslint-disable-next-line deprecation/deprecation
6258
mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) as T;
6359
} catch (e) {
6460
// no-empty

packages/core/src/utils-hoist/propagationContext.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
import type { PropagationContext } from '../types-hoist';
21
import { uuid4 } from './misc';
32

4-
/**
5-
* Returns a new minimal propagation context.
6-
*
7-
* @deprecated Use `generateTraceId` and `generateSpanId` instead.
8-
*/
9-
export function generatePropagationContext(): PropagationContext {
10-
return {
11-
traceId: generateTraceId(),
12-
sampleRand: Math.random(),
13-
};
14-
}
15-
163
/**
174
* Generate a random, valid trace ID.
185
*/

packages/deno/README.md

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

1313
## Links
1414

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

packages/nestjs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
"access": "public"
4545
},
4646
"dependencies": {
47-
"@opentelemetry/core": "^1.29.0",
48-
"@opentelemetry/instrumentation": "^0.56.0",
49-
"@opentelemetry/instrumentation-nestjs-core": "0.43.0",
47+
"@opentelemetry/core": "^1.30.1",
48+
"@opentelemetry/instrumentation": "^0.57.1",
49+
"@opentelemetry/instrumentation-nestjs-core": "0.44.0",
5050
"@sentry/core": "8.45.0",
5151
"@sentry/node": "8.45.0"
5252
},

packages/nestjs/src/integrations/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// https://github.com/fastify/fastify/blob/87f9f20687c938828f1138f91682d568d2a31e53/types/request.d.ts#L41
55
interface FastifyRequest {
66
routeOptions?: {
7-
method?: string;
87
url?: string;
98
};
9+
method?: string;
1010
}
1111

1212
// Partial extract of ExpressRequest interface

packages/nestjs/src/setup.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import { isExpectedError } from './helpers';
1616
// https://github.com/fastify/fastify/blob/87f9f20687c938828f1138f91682d568d2a31e53/types/request.d.ts#L41
1717
interface FastifyRequest {
1818
routeOptions?: {
19-
method?: string;
2019
url?: string;
2120
};
21+
method?: string;
2222
}
2323

2424
// Partial extract of ExpressRequest interface
@@ -57,9 +57,7 @@ class SentryTracingInterceptor implements NestInterceptor {
5757
const req = context.switchToHttp().getRequest() as FastifyRequest | ExpressRequest;
5858
if ('routeOptions' in req && req.routeOptions?.url) {
5959
// fastify case
60-
getIsolationScope().setTransactionName(
61-
`${(req.routeOptions.method || 'GET').toUpperCase()} ${req.routeOptions.url}`,
62-
);
60+
getIsolationScope().setTransactionName(`${(req.method || 'GET').toUpperCase()} ${req.routeOptions.url}`);
6361
} else if ('route' in req && req.route?.path) {
6462
// express case
6563
getIsolationScope().setTransactionName(`${(req.method || 'GET').toUpperCase()} ${req.route.path}`);

packages/nextjs/src/config/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export type SentryBuildOptions = {
122122
*/
123123
sourcemaps?: {
124124
/**
125-
* Disable any functionality related to source maps upload.
125+
* Disable any functionality related to source maps.
126126
*/
127127
disable?: boolean;
128128

0 commit comments

Comments
 (0)