Skip to content

Commit d951476

Browse files
authored
feat(core)!: Remove deprecated request data methods (#14896)
Removes `extractRequestData`, `addRequestDataToEvent` and `extractPathForTransaction`. ref #14268
1 parent 64d36a9 commit d951476

File tree

14 files changed

+14
-1089
lines changed

14 files changed

+14
-1089
lines changed

docs/migration/v8-to-v9.md

+3
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ Sentry.init({
144144
- The `urlEncode` method has been removed. There is no replacement.
145145
- The `getDomElement` method has been removed. There is no replacement.
146146
- The `memoBuilder` method has been removed. There is no replacement.
147+
- The `extractRequestData` method has been removed. Manually extract relevant data off request instead.
148+
- The `addRequestDataToEvent` method has been removed. Use `addNormalizedRequestDataToEvent` instead.
149+
- The `extractPathForTransaction` method has been removed. There is no replacement.
147150

148151
#### Other/Internal Changes
149152

packages/astro/src/index.server.ts

-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export {
1111
addBreadcrumb,
1212
addEventProcessor,
1313
addIntegration,
14-
// eslint-disable-next-line deprecation/deprecation
15-
addRequestDataToEvent,
1614
amqplibIntegration,
1715
anrIntegration,
1816
disableAnrDetectionForCallback,
@@ -38,8 +36,6 @@ export {
3836
endSession,
3937
expressErrorHandler,
4038
expressIntegration,
41-
// eslint-disable-next-line deprecation/deprecation
42-
extractRequestData,
4339
extraErrorDataIntegration,
4440
fastifyIntegration,
4541
flush,

packages/aws-serverless/src/index.ts

-4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ export {
4242
flush,
4343
close,
4444
getSentryRelease,
45-
// eslint-disable-next-line deprecation/deprecation
46-
addRequestDataToEvent,
4745
DEFAULT_USER_INCLUDES,
48-
// eslint-disable-next-line deprecation/deprecation
49-
extractRequestData,
5046
createGetModuleFromFilename,
5147
anrIntegration,
5248
disableAnrDetectionForCallback,

packages/bun/src/index.ts

-4
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ export {
6262
flush,
6363
close,
6464
getSentryRelease,
65-
// eslint-disable-next-line deprecation/deprecation
66-
addRequestDataToEvent,
6765
DEFAULT_USER_INCLUDES,
68-
// eslint-disable-next-line deprecation/deprecation
69-
extractRequestData,
7066
createGetModuleFromFilename,
7167
anrIntegration,
7268
disableAnrDetectionForCallback,

packages/core/src/integrations/requestdata.ts

+2-21
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { defineIntegration } from '../integration';
22
import type { IntegrationFn } from '../types-hoist';
3-
import {
4-
type AddRequestDataToEventOptions,
5-
addNormalizedRequestDataToEvent,
6-
addRequestDataToEvent,
7-
} from '../utils-hoist/requestdata';
3+
import { type AddRequestDataToEventOptions, addNormalizedRequestDataToEvent } from '../utils-hoist/requestdata';
84

95
export type RequestDataIntegrationOptions = {
106
/**
@@ -25,12 +21,6 @@ export type RequestDataIntegrationOptions = {
2521
email?: boolean;
2622
};
2723
};
28-
29-
/**
30-
* Whether to identify transactions by parameterized path, parameterized path with method, or handler name.
31-
* @deprecated This option does not do anything anymore, and will be removed in v9.
32-
*/
33-
transactionNamingScheme?: 'path' | 'methodPath' | 'handler';
3424
};
3525

3626
const DEFAULT_OPTIONS = {
@@ -93,13 +83,7 @@ const _requestDataIntegration = ((options: RequestDataIntegrationOptions = {}) =
9383
return event;
9484
}
9585

96-
// TODO(v9): Eventually we can remove this fallback branch and only rely on the normalizedRequest above
97-
if (!request) {
98-
return event;
99-
}
100-
101-
// eslint-disable-next-line deprecation/deprecation
102-
return addRequestDataToEvent(event, request, addRequestDataOptions);
86+
return event;
10387
},
10488
};
10589
}) satisfies IntegrationFn;
@@ -116,8 +100,6 @@ function convertReqDataIntegrationOptsToAddReqDataOpts(
116100
integrationOptions: Required<RequestDataIntegrationOptions>,
117101
): AddRequestDataToEventOptions {
118102
const {
119-
// eslint-disable-next-line deprecation/deprecation
120-
transactionNamingScheme,
121103
include: { ip, user, ...requestOptions },
122104
} = integrationOptions;
123105

@@ -148,7 +130,6 @@ function convertReqDataIntegrationOptsToAddReqDataOpts(
148130
ip,
149131
user: addReqDataUserOpt,
150132
request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,
151-
transaction: transactionNamingScheme,
152133
},
153134
};
154135
}

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

-6
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ export type { PromiseBuffer } from './promisebuffer';
6868
export {
6969
DEFAULT_USER_INCLUDES,
7070
addNormalizedRequestDataToEvent,
71-
// eslint-disable-next-line deprecation/deprecation
72-
addRequestDataToEvent,
73-
// eslint-disable-next-line deprecation/deprecation
74-
extractPathForTransaction,
75-
// eslint-disable-next-line deprecation/deprecation
76-
extractRequestData,
7771
winterCGHeadersToDict,
7872
winterCGRequestToRequestData,
7973
httpRequestToRequestData,

0 commit comments

Comments
 (0)