From f4f591960511f516859fcb6f1dda7da645602044 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Tue, 18 Jun 2024 13:55:53 -0400 Subject: [PATCH] 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(); + } +}