Skip to content

Performance Issue for NestJS Project with Sentry Performance Enabled #15725

Closed
@ReneGreen27

Description

@ReneGreen27

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

9.5.0

Framework Version

NestJS

Link to Sentry event

No response

Reproduction Example/SDK Setup

Mini repro app and details regarding performance included in internal ticket #146790

Steps to Reproduce

clean NestJS framework + Sentry. The route for testing simply returned a small JSON text.

According to the measurement results:

Clean framework without Sentry - 30,000 rps, 3ms average response time.

Clean framework + Sentry - 2,500 rps, 39ms average response time.

I used the following Sentry configuration:

Sentry.init({
  dsn: '',
  defaultIntegrations: false,
  integrations: [
  nodeProfilingIntegration(),
  Sentry.nestIntegration(),
  Sentry.httpIntegration(),
  Sentry.onUncaughtExceptionIntegration(),
  Sentry.onUnhandledRejectionIntegration(),
  ],
  environment: 'local',
  tracesSampleRate: 1,
  profilesSampleRate: 1,
});

Reducing the values of tracesSampleRate and profilesSampleRate to 0.1 slightly improves the situation

main performance loss occurs due to the Sentry.httpIntegration() module

Expected Result

Not impactful to app performance to have sentry performance enabled

Actual Result

Performance affected

Metadata

Metadata

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions