Skip to content

[@sentry/tracing][express] Span is missing at the end of the transaction #3159

@special-character

Description

@special-character

Package + Version

  • @sentry/node@5.29.2
  • @sentry/tracing@5.29.2

Description

When I am using Sentry tracing, there appears to be a span missing at the end of the request. I found this GH issue that had the same issue but it was seemingly resolved and I made sure I am using the latest version.

image

I believe I have this set up correctly from the docs:

import { server } from 'nexus'
import * as Sentry from '@sentry/node'
import * as Tracing from '@sentry/tracing'

// @ts-ignore
Sentry.init({
  dsn: 'Secret dsn 🤫',
  environment: process.env.APP_ENVIRONMENT,
  release: process.env.GIT_SHA,
  enabled: true,
  integrations: [
    new Sentry.Integrations.Http({ tracing: true }),
    new Tracing.Integrations.Express({
      app: server.express,
    }),
  ],
  tracesSampleRate: process.env.APP_ENVIRONMENT === 'production' ? 0.5 : 1,
})

server.express.use(Sentry.Handlers.requestHandler())
server.express.use(Sentry.Handlers.tracingHandler())

export { Sentry }

I will keep digging a bit but wanted to post here in case someone else is still running into this or could help out, thanks. This also might be because I am using nexus and there is something that it can't see but I am not entirely sure yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions