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

All global breadcrumbs appear in all captured exceptions. #3120

Closed
4 of 9 tasks
alarbada opened this issue Dec 12, 2020 · 2 comments
Closed
4 of 9 tasks

All global breadcrumbs appear in all captured exceptions. #3120

alarbada opened this issue Dec 12, 2020 · 2 comments
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@alarbada
Copy link

alarbada commented Dec 12, 2020

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

sentry.javascript.node

5.29.0

Description

Describe your issue in detail, ideally, you have a reproducible demo that you can show.

I can't understand why the following code:

const main = async () => {
    Sentry.addBreadcrumb({
        message: 'first'
    })

    Sentry.captureException(new Error('err1'))

    Sentry.addBreadcrumb({
        message: 'second'
    })

    Sentry.captureException(new Error('err2'))

    Sentry.addBreadcrumb({
        message: 'third'
    })

    Sentry.captureException(new Error('err3'))
}

main()

produces 3 exceptions with all three breadcrumbs. I'd expect:

  • Error err1 to have the breadcrumb 'first'
  • Error err2 to have the breadcrumb 'first' and 'second'
  • Error err3 to have the breadcrumb 'first', 'second' and 'third'.

I believe this is a bug, because I can achieve my desired behaviour using captureMessage.

const main = async () => {
    Sentry.addBreadcrumb({
        message: 'first'
    })

    Sentry.captureMessage(new Error('err1'))

    Sentry.addBreadcrumb({
        message: 'second'
    })

    Sentry.captureMessage(new Error('err2'))

    Sentry.addBreadcrumb({
        message: 'third'
    })

    Sentry.captureMessage(new Error('err3'))
}

main()

Here the captured messages have the proper breadcrumbs that I want. In fact, I'd go with captureMessage, but with it I loose stack traces, and it's less semantic. So what's up with captureException? Am I missing something? The docs don't explain this behaviour.

@AdriVanHoudt
Copy link

This might be solvable by using domains

@AbhiPrasad AbhiPrasad added the Package: node Issues related to the Sentry Node SDK label Sep 30, 2021
@github-actions
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
None yet
Development

No branches or pull requests

4 participants