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

Sentry event detail breaks when using google text to speech v5+ #14657

Closed
3 tasks done
bahadirkisbet opened this issue Dec 11, 2024 · 2 comments
Closed
3 tasks done

Sentry event detail breaks when using google text to speech v5+ #14657

bahadirkisbet opened this issue Dec 11, 2024 · 2 comments
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@bahadirkisbet
Copy link

bahadirkisbet commented Dec 11, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.43.0

Framework Version

Node 22.11.0

Link to Sentry event

https://base64ai.sentry.io/issues/6129490763/events/?environment=development&project=6073061&referrer=issue-stream&statsPeriod=30d&stream_index=0

Reproduction Example/SDK Setup

I have this SDK setup

Sentry.init({
    dsn: <my_dsn>,
    environment: process.env.SENTRY_ENVIRONMENT,
    tracesSampleRate: 1,
    profilesSampleRate: 0.1,
    integrations: [
      Sentry.httpIntegration({ tracing: false }),
      Sentry.expressIntegration({ app }),
      nodeProfilingIntegration()
    ],
    serverName: global.serverName,
    beforeBreadcrumb (breadcrumb, _hint) {
      if (breadcrumb.category === 'http') {
        return null
      }
      return breadcrumb
    },
    beforeSendTransaction (event) {
      if (!isTimeout(event)) {
        return null
      }
      if (!event?.transaction?.match(/(\/metrics|\/api\/health)/)) {
        return processSensitiveInformation(event)
      }
      return null
    },

    beforeSend (event) {
      // some code
    }
  })

Steps to Reproduce

I have "@google-cloud/text-to-speech": "^4.0.7", installed. Then, I did throw sentry error and got the last result as seen in the SS
Image

After that, I upgraded this packaged to "@google-cloud/text-to-speech": "^5.6.0", and I have some fields that are not coming to my event object properly. From the screen shot, you may see that we got user and transaction info undefined.
Image

Expected Result

The following fields should exist in the event:

  1. Transaction
  2. User
  3. Url

Image

Actual Result

Image

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 11, 2024
@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Dec 11, 2024
@mydea
Copy link
Member

mydea commented Dec 12, 2024

Hey, thank you for writing in.

First, httpIntegration({ tracing: false }) does nothing, you may want httpIntegration({ spans: false }) instead.

Also, expressIntegration() does not take an app anymore. THis seems like a v7 setup, did you follow all the migration docs to go from v7 to v8 correctly?

Just checking, this may or may not be the problem here, but at least worth a try.

Other than this, I do not see any obvious reason why this would not work. Can you show the code where/how the error was thrown, and where/how the user is set?

Can you also pinpoint in which @google-cloud/text-to-speech version this starts happening? Does it start happening in v5.0.0, or some other specific version?

@bahadirkisbet
Copy link
Author

Hey,

First of all, Sorry for the late reply. I've applied the changes you suggested and it starts to work. I mean obviously malpractice leads this issue. On the other hand, it was very interesting to see that after upgrading text-to-speech, we got this misbehavior.

FYI, I was intentionally throwing exception to reproduce this.

We are settings user after authentication middleware, so it should not be the problem under normal circumstances. However, after applying the changes you suggested, it is resolved. Don't know why ;/

It was occurring every google text to speech version after version 5. So if you insists, it was 5.6.0.

Thank you for your help @mydea .

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
Archived in project
Development

No branches or pull requests

2 participants