Skip to content

Commit

Permalink
feat(core)!: Remove deprecated request data methods (#14896)
Browse files Browse the repository at this point in the history
Removes `extractRequestData`, `addRequestDataToEvent` and
`extractPathForTransaction`.

ref #14268
  • Loading branch information
chargome authored Jan 3, 2025
1 parent 64d36a9 commit d951476
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 1,089 deletions.
3 changes: 3 additions & 0 deletions docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ Sentry.init({
- The `urlEncode` method has been removed. There is no replacement.
- The `getDomElement` method has been removed. There is no replacement.
- The `memoBuilder` method has been removed. There is no replacement.
- The `extractRequestData` method has been removed. Manually extract relevant data off request instead.
- The `addRequestDataToEvent` method has been removed. Use `addNormalizedRequestDataToEvent` instead.
- The `extractPathForTransaction` method has been removed. There is no replacement.

#### Other/Internal Changes

Expand Down
4 changes: 0 additions & 4 deletions packages/astro/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export {
addBreadcrumb,
addEventProcessor,
addIntegration,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
amqplibIntegration,
anrIntegration,
disableAnrDetectionForCallback,
Expand All @@ -38,8 +36,6 @@ export {
endSession,
expressErrorHandler,
expressIntegration,
// eslint-disable-next-line deprecation/deprecation
extractRequestData,
extraErrorDataIntegration,
fastifyIntegration,
flush,
Expand Down
4 changes: 0 additions & 4 deletions packages/aws-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ export {
flush,
close,
getSentryRelease,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
DEFAULT_USER_INCLUDES,
// eslint-disable-next-line deprecation/deprecation
extractRequestData,
createGetModuleFromFilename,
anrIntegration,
disableAnrDetectionForCallback,
Expand Down
4 changes: 0 additions & 4 deletions packages/bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ export {
flush,
close,
getSentryRelease,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
DEFAULT_USER_INCLUDES,
// eslint-disable-next-line deprecation/deprecation
extractRequestData,
createGetModuleFromFilename,
anrIntegration,
disableAnrDetectionForCallback,
Expand Down
23 changes: 2 additions & 21 deletions packages/core/src/integrations/requestdata.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { defineIntegration } from '../integration';
import type { IntegrationFn } from '../types-hoist';
import {
type AddRequestDataToEventOptions,
addNormalizedRequestDataToEvent,
addRequestDataToEvent,
} from '../utils-hoist/requestdata';
import { type AddRequestDataToEventOptions, addNormalizedRequestDataToEvent } from '../utils-hoist/requestdata';

export type RequestDataIntegrationOptions = {
/**
Expand All @@ -25,12 +21,6 @@ export type RequestDataIntegrationOptions = {
email?: boolean;
};
};

/**
* Whether to identify transactions by parameterized path, parameterized path with method, or handler name.
* @deprecated This option does not do anything anymore, and will be removed in v9.
*/
transactionNamingScheme?: 'path' | 'methodPath' | 'handler';
};

const DEFAULT_OPTIONS = {
Expand Down Expand Up @@ -93,13 +83,7 @@ const _requestDataIntegration = ((options: RequestDataIntegrationOptions = {}) =
return event;
}

// TODO(v9): Eventually we can remove this fallback branch and only rely on the normalizedRequest above
if (!request) {
return event;
}

// eslint-disable-next-line deprecation/deprecation
return addRequestDataToEvent(event, request, addRequestDataOptions);
return event;
},
};
}) satisfies IntegrationFn;
Expand All @@ -116,8 +100,6 @@ function convertReqDataIntegrationOptsToAddReqDataOpts(
integrationOptions: Required<RequestDataIntegrationOptions>,
): AddRequestDataToEventOptions {
const {
// eslint-disable-next-line deprecation/deprecation
transactionNamingScheme,
include: { ip, user, ...requestOptions },
} = integrationOptions;

Expand Down Expand Up @@ -148,7 +130,6 @@ function convertReqDataIntegrationOptsToAddReqDataOpts(
ip,
user: addReqDataUserOpt,
request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,
transaction: transactionNamingScheme,
},
};
}
6 changes: 0 additions & 6 deletions packages/core/src/utils-hoist/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ export type { PromiseBuffer } from './promisebuffer';
export {
DEFAULT_USER_INCLUDES,
addNormalizedRequestDataToEvent,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
// eslint-disable-next-line deprecation/deprecation
extractPathForTransaction,
// eslint-disable-next-line deprecation/deprecation
extractRequestData,
winterCGHeadersToDict,
winterCGRequestToRequestData,
httpRequestToRequestData,
Expand Down
Loading

0 comments on commit d951476

Please sign in to comment.