Skip to content

Commit

Permalink
feat(profiling) use continuous profiler instead
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Jun 18, 2024
1 parent c949c1d commit f4f5919
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ import {nodeProfilingIntegration} from '@sentry/profiling-node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [nodeProfilingIntegration()],
profilesSampleRate: 1,
tracesSampleRate: 1,
});

const client = Sentry.getClient();

if(client) {
const profilingIntegration = client.getIntegrationByName("ProfilingIntegration");

if(profilingIntegration) {
// @ts-expect-error this is purposefuly not exposed by the SDK for now
profilingIntegration._profiler.start();
}
}

0 comments on commit f4f5919

Please sign in to comment.