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

Traces created by startSpan are not logged when using @sentry/nestjs #12771

Closed
3 tasks done
Tracked by #12504
zoomkoding opened this issue Jul 4, 2024 · 4 comments
Closed
3 tasks done
Tracked by #12504
Labels
Package: nestjs Issues related to the Sentry Nestjs SDK Type: Bug

Comments

@zoomkoding
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nestjs

SDK Version

8.13.0

Framework Version

Nestjs 10.0.0

Link to Sentry event

No response

SDK Setup/Reproduction Example

No response

Steps to Reproduce

I tried to use startSpan, but it does not log anything in Sentry Traces.

This is how I initialized Sentry.

  Sentry.init({
    dsn: process.env.SENTRY_DSN,
    environment: process.env.NODE_ENV,
    integrations: [
      Sentry.extraErrorDataIntegration({ depth: 10 }),
      nodeProfilingIntegration(),
    ],
    tracesSampleRate: 1.0,
    profilesSampleRate: 1.0,
  });

This is how I used startSpan.

import * as Sentry from '@sentry/nestjs';

const a = () => {
  return Sentry.startSpan({ name: 'test', async () => {
     // do something
  })
}

Expected Result

traces are shown on the web.

Actual Result

No traces on the web.
image

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 4, 2024
@zoomkoding zoomkoding changed the title Nestjs Traces created by startSpan are not logged when using @sentry/nestjs Jul 4, 2024
@AbhiPrasad
Copy link
Member

Hey @zoomkoding thanks for writing in.

If you add debug: true to your Sentry.init call, what gets logged out?

@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 Jul 4, 2024
@AbhiPrasad AbhiPrasad added the Package: nestjs Issues related to the Sentry Nestjs SDK label Jul 4, 2024
@nicohrubec nicohrubec mentioned this issue Jul 5, 2024
@zoomkoding
Copy link
Author

zoomkoding commented Jul 5, 2024

These are the logs. Also, this issue remains the same when using the @SentryTraced decorator which was released today.

Sentry Logger [log]: [Tracing] Starting sampled root span
  op: < unknown op >
  name: handleJoinGameTask
  ID: 16a120e1da4dbf35
Sentry Logger [log]: [Profiling] started profiling transaction: handleJoinGameTask
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: 9181d2a2582a6b53
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID 9181d2a2582a6b53
Sentry Logger [log]: SpanExporter has 1 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: 5044f013698c5070
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID 5044f013698c5070
Sentry Logger [log]: SpanExporter has 2 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: 9e93d9526f29f35f
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID 9e93d9526f29f35f
Sentry Logger [log]: SpanExporter has 3 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: c3eeea602c6c60e6
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID c3eeea602c6c60e6
Sentry Logger [log]: SpanExporter has 4 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: 7b1c50d78d66f795
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID 7b1c50d78d66f795
Sentry Logger [log]: SpanExporter has 5 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: e9d68e5929a29710
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID e9d68e5929a29710
Sentry Logger [log]: SpanExporter has 6 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: 89aeb9d9b39b98ed
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID 89aeb9d9b39b98ed
Sentry Logger [log]: SpanExporter has 7 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for START: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: START
  ID: 6f05fd9a58e84a4c
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "START" with ID 6f05fd9a58e84a4c
Sentry Logger [log]: SpanExporter has 8 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for INSERT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: INSERT
  ID: cc2ebf4ababf0e8e
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "INSERT" with ID cc2ebf4ababf0e8e
Sentry Logger [log]: SpanExporter has 9 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for UPDATE: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: UPDATE
  ID: fe0c4f1790b8eb67
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "UPDATE" with ID fe0c4f1790b8eb67
Sentry Logger [log]: SpanExporter has 10 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: ede5c49ff8b28c4f
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID ede5c49ff8b28c4f
Sentry Logger [log]: SpanExporter has 11 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for COMMIT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: COMMIT
  ID: 0bc2aed79cb36a1f
  parent ID: 16a120e1da4dbf35
  root ID: 16a120e1da4dbf35
  root op: handleJoinGameTask
  root description: handleJoinGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "COMMIT" with ID 0bc2aed79cb36a1f
Sentry Logger [log]: SpanExporter has 12 unsent spans remaining
Sentry Logger [log]: [Tracing] Finishing "handleJoinGameTask" root span "handleJoinGameTask" with ID 16a120e1da4dbf35
Sentry Logger [log]: [Profiling] stopped profiling of transaction: handleJoinGameTask
Sentry Logger [log]: SpanExporter exported 13 spans, 0 unsent spans remaining
Sentry Logger [log]: [Tracing] Starting sampled root span
  op: < unknown op >
  name: handleStartGameTask
  ID: 628898f0fa3e883d
Sentry Logger [log]: [Profiling] started profiling transaction: handleStartGameTask
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: ee3d872fcb7d8486
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID ee3d872fcb7d8486
Sentry Logger [log]: SpanExporter has 1 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: a616c8d339db0936
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID a616c8d339db0936
Sentry Logger [log]: SpanExporter has 2 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: f23aa5f7a8f09376
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID f23aa5f7a8f09376
Sentry Logger [log]: SpanExporter has 3 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: 1f7ede674ca1ceb9
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID 1f7ede674ca1ceb9
Sentry Logger [log]: SpanExporter has 4 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for START: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: START
  ID: ee97f5d75b95b1f9
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "START" with ID ee97f5d75b95b1f9
Sentry Logger [log]: SpanExporter has 5 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for UPDATE: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: UPDATE
  ID: 5c21a9f146b9c3cb
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "UPDATE" with ID 5c21a9f146b9c3cb
Sentry Logger [log]: SpanExporter has 6 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: 06ae3d9a0544a31d
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID 06ae3d9a0544a31d
Sentry Logger [log]: SpanExporter has 7 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for COMMIT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: COMMIT
  ID: 434edd9d01540f95
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "COMMIT" with ID 434edd9d01540f95
Sentry Logger [log]: SpanExporter has 8 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for SELECT: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: SELECT
  ID: d211d129bc7b6453
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "SELECT" with ID d211d129bc7b6453
Sentry Logger [log]: SpanExporter has 9 unsent spans remaining
Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for UPDATE: true
Sentry Logger [log]: [Tracing] Starting sampled span
  op: < unknown op >
  name: UPDATE
  ID: 0032610f5b8ad4c0
  parent ID: 628898f0fa3e883d
  root ID: 628898f0fa3e883d
  root op: handleStartGameTask
  root description: handleStartGameTask
Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "UPDATE" with ID 0032610f5b8ad4c0
Sentry Logger [log]: SpanExporter has 10 unsent spans remaining
Sentry Logger [log]: [Tracing] Finishing "handleStartGameTask" root span "handleStartGameTask" with ID 628898f0fa3e883d
Sentry Logger [log]: [Profiling] stopped profiling of transaction: handleStartGameTask
Sentry Logger [log]: SpanExporter exported 11 spans, 0 unsent spans remaining

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 5, 2024
@AbhiPrasad
Copy link
Member

Okay it seems like the SDK is creating data (traces/spans)

I recommend writing into support @ sentry io (remove spaces) and they can help look examine your account to see why exactly sentry is not ingesting the data.

@zoomkoding
Copy link
Author

This issue has been solved after removing nodeProfilingIntegration() when initializing Sentry.
Thank you for the quick response!

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nestjs Issues related to the Sentry Nestjs SDK Type: Bug
Projects
Archived in project
Development

No branches or pull requests

2 participants