Skip to content

Commit

Permalink
feat(profiling) use continuous profiler instead of the span/txn based…
Browse files Browse the repository at this point in the history
… one (#161)

* feat(profiling) use continuous profiler instead

* Update src/instrument.ts

Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>

* Update src/instrument.ts

Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>

---------

Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
  • Loading branch information
JonasBa and AbhiPrasad authored Jun 18, 2024
1 parent c949c1d commit fca45cf
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 fca45cf

Please sign in to comment.