Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(profiling) use continuous profiler instead of the span/txn based one #161

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting, this doesn't require a profilesSampleRate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we actually rely on it not being set. It's a bit weird from the API pov, but we dont want to apply the sampling rate per chunk.

}
}
Loading