Skip to content

Can't get this package to work at all, am I missing something? #684

@abecks

Description

@abecks

This looks like a great wrapper for Sentry + Fastify. I'd love to use it in my project.

I don't know if I'm missing an important step in the instructions or something, but I cannot get this to work at all:

import fastifySentry from '@immobiliarelabs/fastify-sentry'
await fastify.register(fastifySentry, {
  dsn: process.env.SENTRY_DSN,
  debug: true,
  environment: process.env.SERVER_ENV,
  tracesSampleRate: 1.0,
  release: '1.0.0',
})
fastify.route({
  method: 'GET',
  url: '/test',
  handler: async (request, reply) => {
    throw new Error('test1234')
  },
})

I have the following issues:

  1. The error is never captured in my Sentry UI. The call to captureException in base.js is firing, but nothing is showing up in Sentry.
  2. Calling fastify.Sentry.captureMessage() doesn't work either
  3. Enabling tracing with tracesSampleRate: 1.0 does not work because if (hasTracingEnabled()) { in request.js evaluates to false.

I've ensured my SENTRY_DSN is correct, as it works when I use the Sentry Node SDK, and double checked your examples and I don't think I'm missing anything.

Any ideas would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions