Skip to content

Commit 93f5c19

Browse files
Merge branch 'v7' of github.com:getsentry/sentry-javascript into egou/v7/feat/create-interaction-spans-on-inp
2 parents b515f8e + beed7f6 commit 93f5c19

File tree

7 files changed

+83
-44
lines changed

7 files changed

+83
-44
lines changed

MIGRATION.md

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -157,46 +157,48 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t
157157

158158
The following list shows how integrations should be migrated:
159159

160-
| Old | New | Packages |
161-
| ---------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------- |
162-
| `new BrowserTracing()` | `browserTracingIntegration()` | `@sentry/browser` |
163-
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
164-
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
165-
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
166-
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
167-
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
168-
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
169-
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
170-
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
171-
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |
172-
| `new CaptureConsole()` | `captureConsoleIntegration()` | `@sentry/integrations` |
173-
| `new Debug()` | `debugIntegration()` | `@sentry/integrations` |
174-
| `new Dedupe()` | `dedupeIntegration()` | `@sentry/browser`, `@sentry/integrations`, `@sentry/deno` |
175-
| `new ExtraErrorData()` | `extraErrorDataIntegration()` | `@sentry/integrations` |
176-
| `new ReportingObserver()` | `reportingObserverIntegration()` | `@sentry/integrations` |
177-
| `new RewriteFrames()` | `rewriteFramesIntegration()` | `@sentry/integrations` |
178-
| `new SessionTiming()` | `sessionTimingIntegration()` | `@sentry/integrations` |
179-
| `new HttpClient()` | `httpClientIntegration()` | `@sentry/integrations` |
180-
| `new ContextLines()` | `contextLinesIntegration()` | `@sentry/integrations`, `@sentry/node`, `@sentry/deno`, `@sentry/bun` |
181-
| `new Breadcrumbs()` | `breadcrumbsIntegration()` | `@sentry/browser`, `@sentry/deno` |
182-
| `new GlobalHandlers()` | `globalHandlersIntegration()` | `@sentry/browser` , `@sentry/deno` |
183-
| `new HttpContext()` | `httpContextIntegration()` | `@sentry/browser` |
184-
| `new TryCatch()` | `browserApiErrorsIntegration()` | `@sentry/browser`, `@sentry/deno` |
185-
| `new VueIntegration()` | `vueIntegration()` | `@sentry/vue` |
186-
| `new DenoContext()` | `denoContextIntegration()` | `@sentry/deno` |
187-
| `new DenoCron()` | `denoCronIntegration()` | `@sentry/deno` |
188-
| `new NormalizePaths()` | `normalizePathsIntegration()` | `@sentry/deno` |
189-
| `new Console()` | `consoleIntegration()` | `@sentry/node` |
190-
| `new Context()` | `nodeContextIntegration()` | `@sentry/node` |
191-
| `new Modules()` | `modulesIntegration()` | `@sentry/node` |
192-
| `new OnUncaughtException()` | `onUncaughtExceptionIntegration()` | `@sentry/node` |
193-
| `new OnUnhandledRejection()` | `onUnhandledRejectionIntegration()` | `@sentry/node` |
194-
| `new LocalVariables()` | `localVariablesIntegration()` | `@sentry/node` |
195-
| `new Spotlight()` | `spotlightIntegration()` | `@sentry/node` |
196-
| `new Anr()` | `anrIntegration()` | `@sentry/node` |
197-
| `new Hapi()` | `hapiIntegration()` | `@sentry/node` |
198-
| `new Undici()` | `nativeNodeFetchIntegration()` | `@sentry/node` |
199-
| `new Http()` | `httpIntegration()` | `@sentry/node` |
160+
| Old | New | Packages |
161+
| ----------------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------- |
162+
| `new BrowserTracing()` | `browserTracingIntegration()` | `@sentry/browser` |
163+
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
164+
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
165+
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
166+
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
167+
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
168+
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
169+
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
170+
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
171+
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |
172+
| `new CaptureConsole()` | `captureConsoleIntegration()` | `@sentry/integrations` |
173+
| `new Debug()` | `debugIntegration()` | `@sentry/integrations` |
174+
| `new Dedupe()` | `dedupeIntegration()` | `@sentry/browser`, `@sentry/integrations`, `@sentry/deno` |
175+
| `new ExtraErrorData()` | `extraErrorDataIntegration()` | `@sentry/integrations` |
176+
| `new ReportingObserver()` | `reportingObserverIntegration()` | `@sentry/integrations` |
177+
| `new RewriteFrames()` | `rewriteFramesIntegration()` | `@sentry/integrations` |
178+
| `new SessionTiming()` | `sessionTimingIntegration()` | `@sentry/integrations` |
179+
| `new HttpClient()` | `httpClientIntegration()` | `@sentry/integrations` |
180+
| `new ContextLines()` | `contextLinesIntegration()` | `@sentry/integrations`, `@sentry/node`, `@sentry/deno`, `@sentry/bun` |
181+
| `new Breadcrumbs()` | `breadcrumbsIntegration()` | `@sentry/browser`, `@sentry/deno` |
182+
| `new GlobalHandlers()` | `globalHandlersIntegration()` | `@sentry/browser` , `@sentry/deno` |
183+
| `new HttpContext()` | `httpContextIntegration()` | `@sentry/browser` |
184+
| `new TryCatch()` | `browserApiErrorsIntegration()` | `@sentry/browser`, `@sentry/deno` |
185+
| `new VueIntegration()` | `vueIntegration()` | `@sentry/vue` |
186+
| `new DenoContext()` | `denoContextIntegration()` | `@sentry/deno` |
187+
| `new DenoCron()` | `denoCronIntegration()` | `@sentry/deno` |
188+
| `new NormalizePaths()` | `normalizePathsIntegration()` | `@sentry/deno` |
189+
| `new Console()` | `consoleIntegration()` | `@sentry/node` |
190+
| `new Context()` | `nodeContextIntegration()` | `@sentry/node` |
191+
| `new Modules()` | `modulesIntegration()` | `@sentry/node` |
192+
| `new OnUncaughtException()` | `onUncaughtExceptionIntegration()` | `@sentry/node` |
193+
| `new OnUnhandledRejection()` | `onUnhandledRejectionIntegration()` | `@sentry/node` |
194+
| `new LocalVariables()` | `localVariablesIntegration()` | `@sentry/node` |
195+
| `new Spotlight()` | `spotlightIntegration()` | `@sentry/node` |
196+
| `new Anr()` | `anrIntegration()` | `@sentry/node` |
197+
| `new Hapi()` | `hapiIntegration()` | `@sentry/node` |
198+
| `new Undici()` | `nativeNodeFetchIntegration()` | `@sentry/node` |
199+
| `new Http()` | `httpIntegration()` | `@sentry/node` |
200+
| `new ProfilingIntegration()` | `nodeProfilingIntegration()` | `@sentry/profiling-node` |
201+
| `new BrowserProfilingIntegration()` | `browserProfilingIntegration()` | `@sentry/browser` |
200202

201203
## Deprecate `hub.bindClient()` and `makeMain()`
202204

packages/profiling-node/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ npm install --save @sentry/node @sentry/profiling-node
2727

2828
```javascript
2929
import * as Sentry from '@sentry/node';
30-
import { ProfilingIntegration } from '@sentry/profiling-node';
30+
import { nodeProfilingIntegration } from '@sentry/profiling-node';
3131

3232
Sentry.init({
3333
dsn: 'https://[email protected]/6625302',
3434
debug: true,
3535
tracesSampleRate: 1,
3636
profilesSampleRate: 1, // Set profiling sampling rate.
37-
integrations: [new ProfilingIntegration()],
37+
integrations: [nodeProfilingIntegration()],
3838
});
3939
```
4040

packages/profiling-node/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
export { ProfilingIntegration } from './integration';
1+
export {
2+
// eslint-disable-next-line deprecation/deprecation
3+
ProfilingIntegration,
4+
nodeProfilingIntegration,
5+
} from './integration';

packages/profiling-node/src/integration.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import type { NodeClient } from '@sentry/node';
2-
import type { Event, EventProcessor, Hub, Integration, Transaction } from '@sentry/types';
2+
import type {
3+
Event,
4+
EventProcessor,
5+
Hub,
6+
Integration,
7+
IntegrationFn,
8+
IntegrationFnResult,
9+
Transaction,
10+
} from '@sentry/types';
311

412
import { logger } from '@sentry/utils';
513

@@ -39,6 +47,8 @@ function addToProfileQueue(profile: RawThreadCpuProfile): void {
3947
* and inspect each event to see if it is a transaction event and if that transaction event
4048
* contains a profile on it's metadata. If that is the case, we create a profiling event envelope
4149
* and delete the profile from the transaction metadata.
50+
*
51+
* @deprecated Use `nodeProfilingIntegration` instead.
4252
*/
4353
export class ProfilingIntegration implements Integration {
4454
/**
@@ -243,3 +253,14 @@ export class ProfilingIntegration implements Integration {
243253
return maybeRemoveProfileFromSdkMetadata(event);
244254
}
245255
}
256+
257+
/**
258+
* We need this integration in order to send data to Sentry. We hook into the event processor
259+
* and inspect each event to see if it is a transaction event and if that transaction event
260+
* contains a profile on it's metadata. If that is the case, we create a profiling event envelope
261+
* and delete the profile from the transaction metadata.
262+
*/
263+
export const nodeProfilingIntegration = (() => {
264+
// eslint-disable-next-line deprecation/deprecation
265+
return new ProfilingIntegration() as unknown as IntegrationFnResult;
266+
}) satisfies IntegrationFn;

packages/profiling-node/test/hubextensions.hub.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { CpuProfilerBindings } from '../src/cpu_profiler';
77
import { ProfilingIntegration } from '../src/index';
88

99
function makeClientWithoutHooks(): [Sentry.NodeClient, Transport] {
10+
// eslint-disable-next-line deprecation/deprecation
1011
const integration = new ProfilingIntegration();
1112
const transport = Sentry.makeNodeTransport({
1213
url: 'https://[email protected]/6625302',
@@ -41,6 +42,7 @@ function makeClientWithoutHooks(): [Sentry.NodeClient, Transport] {
4142
}
4243

4344
function makeClientWithHooks(): [Sentry.NodeClient, Transport] {
45+
// eslint-disable-next-line deprecation/deprecation
4446
const integration = new ProfilingIntegration();
4547
const client = new Sentry.NodeClient({
4648
stackParser: Sentry.defaultStackParser,

packages/profiling-node/test/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function makeStaticTransport(): MockTransport {
2323
}
2424

2525
function makeClientWithoutHooks(): [Sentry.NodeClient, MockTransport] {
26+
// eslint-disable-next-line deprecation/deprecation
2627
const integration = new ProfilingIntegration();
2728
const transport = makeStaticTransport();
2829
const client = new Sentry.NodeClient({

0 commit comments

Comments
 (0)