From f4f591960511f516859fcb6f1dda7da645602044 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Tue, 18 Jun 2024 13:55:53 -0400 Subject: [PATCH 1/3] feat(profiling) use continuous profiler instead --- src/instrument.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/instrument.ts b/src/instrument.ts index e8b7951..f1a6987 100644 --- a/src/instrument.ts +++ b/src/instrument.ts @@ -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(); + } +} From 4d2c2a3639d047d690d4b037c9a2930ab17e20c9 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 18 Jun 2024 14:59:01 -0400 Subject: [PATCH 2/3] Update src/instrument.ts Co-authored-by: Abhijeet Prasad --- src/instrument.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instrument.ts b/src/instrument.ts index f1a6987..52d81a1 100644 --- a/src/instrument.ts +++ b/src/instrument.ts @@ -9,7 +9,7 @@ Sentry.init({ const client = Sentry.getClient(); -if(client) { +if (client) { const profilingIntegration = client.getIntegrationByName("ProfilingIntegration"); if(profilingIntegration) { From 93f0f6f980a8a7c7437dde7df1ed9559d813e4eb Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 18 Jun 2024 14:59:07 -0400 Subject: [PATCH 3/3] Update src/instrument.ts Co-authored-by: Abhijeet Prasad --- src/instrument.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instrument.ts b/src/instrument.ts index 52d81a1..c73d8e6 100644 --- a/src/instrument.ts +++ b/src/instrument.ts @@ -12,7 +12,7 @@ const client = Sentry.getClient(); if (client) { const profilingIntegration = client.getIntegrationByName("ProfilingIntegration"); - if(profilingIntegration) { + if (profilingIntegration) { // @ts-expect-error this is purposefuly not exposed by the SDK for now profilingIntegration._profiler.start(); }