monti-apm / monti-apm-agent

Monitor Meteor apps with Monti APM

Home Page:https://montiapm.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Manual calls of Monti.trackError doesn't include previous actions

vrizo opened this issue · comments

Hello!

Thank you for this beautiful package! We use your project in Chatra, and we love it. We want to use Monti APM to debug some weird bugs. The only issue is that I don't see the preceding actions in the Monti APM Dashboard:

Screenshot 2022-10-25 at 15 43 38

Compare it with the production environment when Monti catches real errors:

Screenshot 2022-10-25 at 15 44 01

I added the call like this:

Monti.trackError(new Error('Test error 2'));

Also, I tried to wrap it like this:

const event = Monti.startEvent('sibInterop', {
  details: true
});

 // lots of HTTP requests

Monti.trackError(new Error('Test error 2'));



Monti.endEvent(event, {
  additionalDetails: true
});

And I set eventStackTrace to true in our settings.json. But nothing helps. I see only a single error message instead of a full stack trace.

Is it possible to fix it? Can you please recommend something?

Our versions:

meteor@1.10.0
montiapm:agent@2.45.1
montiapm:meteorx@2.2.0

Hey @vrizo where are you running that code, is it inside a method? How are you making the http calls? Which package?

The trackError by itself will not capture the data I am afraid. Here is my attempt, it did track database operations:

image

image

Are the options you mentioned the only ones you are using? Can you provide an anonymized version of the options for us?

When using Monti.trackError, it creates a new trace with just the start and error events:

let trace = {
type: type || 'server-internal',
subType: subType || 'server',
name: message,
errored: true,
at: Kadira.syncedDate.getTime(),
events: [['start', 0, {}], ['error', 0, { error: { message, stack } }]],
metrics: { total: 0 }
};
. We should have it check if there is a trace currently running, and use it.

@vrizo I published a beta today which fixes this. You can try it by running

meteor add montiapm:agent@2.47.0-beta.1 

Thank you, guys! Sorry for the late answer, I didn't get any notifications from Github 🙈 I'll check the updated version next week.

We've released version 2.47.0.

Thanks you, guys, @zodern @leonardoventurini! The updated version (2.47.0) works perfectly now 🎉

Screenshot 2023-01-17 at 13 31 39