Skip to content
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

feat(core): Deprecate debugIntegration and sessionTimingIntegration #14363

Merged
merged 2 commits into from
Nov 19, 2024
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
2 changes: 2 additions & 0 deletions docs/migration/draft-v9-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
## `@sentry/core`

- Deprecated `transactionNamingScheme` option in `requestDataIntegration`.
- Deprecated `debugIntegration`. To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...).
- Deprecated `sessionTimingIntegration`. To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`).

## `@sentry/types`

Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@
"proseWrap": "always",
"singleQuote": true,
"trailingComma": "all",
"overrides": [{
"files": "CHANGELOG.md",
"options": {
"proseWrap": "preserve"
"overrides": [
{
"files": "*.md",
"options": {
"proseWrap": "preserve"
}
}
}]
]
}
}
2 changes: 2 additions & 0 deletions packages/astro/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export {
createTransport,
cron,
dataloaderIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
DEFAULT_USER_INCLUDES,
Expand Down Expand Up @@ -103,6 +104,7 @@ export {
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
setContext,
setCurrentClient,
Expand Down
2 changes: 2 additions & 0 deletions packages/aws-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ export {

export {
captureConsoleIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
extraErrorDataIntegration,
rewriteFramesIntegration,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
} from '@sentry/core';

Expand Down
2 changes: 2 additions & 0 deletions packages/browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ export { contextLinesIntegration } from './integrations/contextlines';

export {
captureConsoleIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
extraErrorDataIntegration,
rewriteFramesIntegration,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
captureFeedback,
} from '@sentry/core';
Expand Down
1 change: 1 addition & 0 deletions packages/browser/src/integrations-bundle/index.debug.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// eslint-disable-next-line deprecation/deprecation
export { debugIntegration } from '@sentry/core';
export { spotlightBrowserIntegration } from '../integrations/spotlight';
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// eslint-disable-next-line deprecation/deprecation
export { sessionTimingIntegration } from '@sentry/core';
2 changes: 2 additions & 0 deletions packages/bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,12 @@ export {

export {
captureConsoleIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
extraErrorDataIntegration,
rewriteFramesIntegration,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
} from '@sentry/core';

Expand Down
1 change: 1 addition & 0 deletions packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export {
linkedErrorsIntegration,
requestDataIntegration,
extraErrorDataIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
rewriteFramesIntegration,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ export { linkedErrorsIntegration } from './integrations/linkederrors';
export { moduleMetadataIntegration } from './integrations/metadata';
export { requestDataIntegration } from './integrations/requestdata';
export { captureConsoleIntegration } from './integrations/captureconsole';
// eslint-disable-next-line deprecation/deprecation
export { debugIntegration } from './integrations/debug';
export { dedupeIntegration } from './integrations/dedupe';
export { extraErrorDataIntegration } from './integrations/extraerrordata';
export { rewriteFramesIntegration } from './integrations/rewriteframes';
// eslint-disable-next-line deprecation/deprecation
export { sessionTimingIntegration } from './integrations/sessiontiming';
export { zodErrorsIntegration } from './integrations/zoderrors';
export { thirdPartyErrorFilterIntegration } from './integrations/third-party-errors-filter';
Expand Down
11 changes: 7 additions & 4 deletions packages/core/src/integrations/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ interface DebugOptions {
debugger?: boolean;
}

/**
* Integration to debug sent Sentry events.
* This integration should not be used in production.
*/
const _debugIntegration = ((options: DebugOptions = {}) => {
const _options = {
debugger: false,
Expand Down Expand Up @@ -51,4 +47,11 @@ const _debugIntegration = ((options: DebugOptions = {}) => {
};
}) satisfies IntegrationFn;

/**
* Integration to debug sent Sentry events.
* This integration should not be used in production.
*
* @deprecated This integration is deprecated and will be removed in the next major version of the SDK.
* To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...).
*/
export const debugIntegration = defineIntegration(_debugIntegration);
3 changes: 3 additions & 0 deletions packages/core/src/integrations/sessiontiming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ const _sessionTimingIntegration = (() => {
/**
* This function adds duration since the sessionTimingIntegration was initialized
* till the time event was sent.
*
* @deprecated This integration is deprecated and will be removed in the next major version of the SDK.
* To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`).
*/
export const sessionTimingIntegration = defineIntegration(_sessionTimingIntegration);
5 changes: 5 additions & 0 deletions packages/core/test/lib/integrations/debug.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { Client, Event, EventHint } from '@sentry/types';
import { debugIntegration } from '../../../src/integrations/debug';

function testEventLogged(
// eslint-disable-next-line deprecation/deprecation
integration: ReturnType<typeof debugIntegration>,
testEvent?: Event,
testEventHint?: EventHint,
Expand Down Expand Up @@ -42,6 +43,7 @@ describe('Debug integration setup should register an event processor that', () =
});

it('logs an event', () => {
// eslint-disable-next-line deprecation/deprecation
const debug = debugIntegration();
const testEvent = { event_id: 'some event' };

Expand All @@ -52,6 +54,7 @@ describe('Debug integration setup should register an event processor that', () =
});

it('logs an event hint if available', () => {
// eslint-disable-next-line deprecation/deprecation
const debug = debugIntegration();

const testEvent = { event_id: 'some event' };
Expand All @@ -65,6 +68,7 @@ describe('Debug integration setup should register an event processor that', () =
});

it('logs events in stringified format when `stringify` option was set', () => {
// eslint-disable-next-line deprecation/deprecation
const debug = debugIntegration({ stringify: true });
const testEvent = { event_id: 'some event' };

Expand All @@ -75,6 +79,7 @@ describe('Debug integration setup should register an event processor that', () =
});

it('logs event hints in stringified format when `stringify` option was set', () => {
// eslint-disable-next-line deprecation/deprecation
const debug = debugIntegration({ stringify: true });

const testEvent = { event_id: 'some event' };
Expand Down
1 change: 1 addition & 0 deletions packages/core/test/lib/integrations/sessiontiming.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Event } from '@sentry/types';
import { sessionTimingIntegration } from '../../../src/integrations/sessiontiming';

// eslint-disable-next-line deprecation/deprecation
const sessionTiming = sessionTimingIntegration();

describe('SessionTiming', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ export {
functionToStringIntegration,
requestDataIntegration,
captureConsoleIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
extraErrorDataIntegration,
rewriteFramesIntegration,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
zodErrorsIntegration,
SEMANTIC_ATTRIBUTE_SENTRY_OP,
Expand Down
2 changes: 2 additions & 0 deletions packages/google-cloud-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ export {

export {
captureConsoleIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
extraErrorDataIntegration,
rewriteFramesIntegration,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
} from '@sentry/core';

Expand Down
2 changes: 2 additions & 0 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ export {
captureMessage,
captureFeedback,
captureConsoleIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
extraErrorDataIntegration,
rewriteFramesIntegration,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
// eslint-disable-next-line deprecation/deprecation
metricsDefault as metrics,
Expand Down
2 changes: 2 additions & 0 deletions packages/remix/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export {
createGetModuleFromFilename,
createTransport,
cron,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
DEFAULT_USER_INCLUDES,
Expand Down Expand Up @@ -100,6 +101,7 @@ export {
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
setContext,
setCurrentClient,
Expand Down
2 changes: 2 additions & 0 deletions packages/solidstart/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export {
createGetModuleFromFilename,
createTransport,
cron,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
DEFAULT_USER_INCLUDES,
Expand Down Expand Up @@ -91,6 +92,7 @@ export {
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
setContext,
setCurrentClient,
Expand Down
2 changes: 2 additions & 0 deletions packages/sveltekit/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export {
createGetModuleFromFilename,
createTransport,
cron,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
DEFAULT_USER_INCLUDES,
Expand Down Expand Up @@ -93,6 +94,7 @@ export {
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
// eslint-disable-next-line deprecation/deprecation
sessionTimingIntegration,
setContext,
setCurrentClient,
Expand Down
1 change: 1 addition & 0 deletions packages/vercel-edge/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export {
linkedErrorsIntegration,
requestDataIntegration,
extraErrorDataIntegration,
// eslint-disable-next-line deprecation/deprecation
debugIntegration,
dedupeIntegration,
rewriteFramesIntegration,
Expand Down
Loading