Skip to content

feat(core)!: Remove deprecated request data methods #14896

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 5 commits into from
Jan 3, 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
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 `Request` type has been removed. Use `RequestEventData` type instead.
- The `TransactionNamingScheme` type 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.

### `@sentry/browser`

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
Loading