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

Unable to integrate sentry performance monitoring and profiling with Foal TS #1248

Open
premji012 opened this issue Mar 4, 2024 · 1 comment
Labels

Comments

@premji012
Copy link

premji012 commented Mar 4, 2024

Version of FoalTS: 4.2.0

I was recently trying to integrate sentry Performance monitoring and profiling with a Foal TS based application. I used the same logic that we use to integrate sentry APM with an express application. It is working well with express but if i use the same techinique in Foal TS it is not working

  const expressInstance = express();
 
  const app = await createApp(AppController);
 
  Sentry.init({
    dsn: ***',
    tracesSampleRate: 1.0,
    profilesSampleRate: 1.0, // Profiling sample rate is relative to tracesSampleRate
    // includeLocalVariables: true,
    integrations: [
      // enable HTTP calls tracing
      new Sentry.Integrations.Http({ tracing: true }),
      new Sentry.Integrations.Express({ app: expressInstance }),
      // // Automatically instrument Node.js libraries and frameworks
      // // (This function is slow because of file I/O, consider manually adding additional integrations instead)
      //...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(),
      // Add profiling integration to list of integrations
      new ProfilingIntegration(),
      // new Sentry.Integrations.LocalVariables({ captureAllExceptions: true })
    ],
  });
 
  expressInstance.use(Sentry.Handlers.requestHandler());
  expressInstance.use(Sentry.Handlers.tracingHandler());
  expressInstance.use(Sentry.Handlers.errorHandler())
@premji012 premji012 added the bug label Mar 4, 2024
@LoicPoullain LoicPoullain added this to Backlog in Issue tracking via automation Mar 5, 2024
@LoicPoullain
Copy link
Member

Hi @premji012 👋

It looks like you didn't pass the expressInstance to the createApp function, right?

Also, I'm not very familiar with Sentry. Do you know what are the three middlewares used for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Issue tracking
  
Backlog
Development

No branches or pull requests

2 participants