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

Transactions not being recorded #6237

Closed
3 tasks done
User9684 opened this issue Nov 18, 2022 · 11 comments
Closed
3 tasks done

Transactions not being recorded #6237

User9684 opened this issue Nov 18, 2022 · 11 comments

Comments

@User9684
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/node

SDK Version

7.20

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

Using this for init:

const Sentry = require('@sentry/node');
const mongodb = require('mongodb');
const Tracing = require('@sentry/tracing');
require('dotenv').config();

Sentry.init({
  dsn: 'sentry DSN',
  tracesSampleRate: 1.0,
  attachStacktrace: true,
  debug: true,
  environment: process.env.VERSION,
  release: process.env.CAPROVER_GIT_COMMIT_SHA,
  integrations: [
    new Sentry.Integrations.Http({ tracing: true }),
    new Tracing.Integrations.Mongo({ useMongoose: true }),
  ],
});

module.exports = Sentry

Code ran:

const Sentry = require('@sentry/node');

try {
    const transaction = Sentry.startTransaction({
      op: 'command_ran',
      name: 'command_recieved',
      startTimestamp: Date.now(),
      tags: {
        guildId: interaction.guildID,
        interactionId: interaction.id,
        shardId: client.guilds.get(interaction.guildID).shard.id,
      },
    })

    const span1 = transaction.startChild({
      op: 'command_calculating',
      description: 'Calculating how to run the command',
    })
    const canRun = true
    if (canRun) {

      span1.finish()

      if (!isOnCooldown) {
        const span2 = transaction.startChild({
          op: 'command_executing',
          description: 'A command being ran',
        })
        // Execution...

        span2.finish()
      }
    }

    transaction.finish()
} catch (err) {
  Sentry.captureException(err)
  if (process.env.VERSION.toLocaleLowerCase() !== 'production') console.error(err)
}

Expected Result

A transaction is made inside performance tab

Actual Result

Nothing is made, library returns an ID but it leads to nowhere.

image

@User9684
Copy link
Author

Also, for some reason this snippet of code below works perfectly fine for recording transactions. Albeit takes awhile for the transaction to show under the performance page.

const sentry = require('@sentry/node');
const trans_ = sentry.startTransaction({
op: 'test_uwu',
name: 'test_transaction'
});
const span_ = trans_.startChild({
op: 'test_span'
});

span_.finish();
trans_.finish();

@User9684
Copy link
Author

User9684 commented Nov 18, 2022

Also, the ID returned by the library is not correct, as shown in 6229.

Though, I could also just be trying to view the event incorrectly, correct me if I'm wrong but is it sentry.io/organizations/org/events/ID Here/? When I attempt to put the ID in there, it just displays a blank screen.

@lobsterkatie
Copy link
Member

lobsterkatie commented Nov 18, 2022

Hi, @User9684.

Sorry you're having trouble!

To find an event with a particular id, you can paste it into the search box at the top of the Discover page, prefaced with id::

image

That said, you have discovered a bug! Going to sentry.io/organizations/org/events/ID Here/ leads to what appears to be an infinite redirect loop. I've reported it to our frontend team and they'll take a look.

Can you please try that and let me know if transaction events actually still aren't showing up? Also, can you please confirm in the network tab that the outgoing request to our servers is being made successfully?

@User9684
Copy link
Author

Thanks for the reply! The requests are indeed being sent, however only the ones of which I used the 2nd snippet are actually appearing.
image
There should be multiple transactions here named "command_ran", but only "test_transaction" is there.

@lobsterkatie
Copy link
Member

So, just to be super clear:

  • You tried searching for the transaction id (b86c... in your screenshot) in Discover using id:b86c... and got nothing, and
  • You can see that there's an outgoing request whose contents is the command_ran transaction, and it comes back as a 200?

If so, can you please share a link to one of your test_transaction events? Also, can you boil the non-working snippet down to the simplest version you can which is still not showing up in your org?

@User9684
Copy link
Author

Sorry for the late reply, here's an example of one of the test_transaction events: here

@User9684
Copy link
Author

Hi, @User9684.

Sorry you're having trouble!

To find an event with a particular id, you can paste it into the search box at the top of the Discover page, prefaced with id::

image

That said, you have discovered a bug! Going to sentry.io/organizations/org/events/ID Here/ leads to what appears to be an infinite redirect loop. I've reported it to our frontend team and they'll take a look.

Can you please try that and let me know if transaction events actually still aren't showing up? Also, can you please confirm in the network tab that the outgoing request to our servers is being made successfully?

Also, doing id: f3f7b2c2ec9a499b819b72b9bad532eb doesn't seem to work for me. The JS library returned f3f7b2c2ec9a499b819b72b9bad532eb for an error's ID but it does not seem to be connected to anything.

@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 🥀

@User9684
Copy link
Author

I still have this issue...

@lforst
Copy link
Member

lforst commented Dec 14, 2022

Hi, I tried your snippets and I believe your transactions are getting dropped by our ingest pipeline because of startTimestamp: Date.now(). This option takes seconds and not milliseconds (which Date.now() returns). I recommend simply omitting this option for this use-case.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

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 🥀

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants