Monti/Kadira - Is it possible to get traces for code called directly from the server?

We have a meteor 2.X app that is running some cron/scheduled jobs which call some functions. We would like to be able to see the traces of these function calls in monti/kadira, so I wrapped them inside methods hoping that would help Monti seeing them, but it didn’t work. I’ve also tried startEvent/endEvent and trying to use bindEnvironment just in case, but no luck at all.
Has anyone achieved this or has found a way to do this?

Ideally would like to avoid having to define rest endpoints and call them from the same machine just to track the invokation in monti.

How about Ostrio logger, save to a free MongoDB (Atlas) and build a small visualizer for what you need to see.
With ostrio logger you can also trigger errors as server errors which will end up into your Monti.

https://packosphere.com/ostrio/logger

I’ve actually been working on adding job monitoring to Monti APM the last few weeks. I’m planning to release it early December.

It’s designed to support:

  • cron jobs
  • job queues
  • or you can trace any function you want

I built a new architecture for storing traces that scales much better, and am currently working on updating the agent to better support uploading a large number of traces.

The api to create a custom trace will look something like:

Monti.traceJob({ name: 'job name' }, () => {
  // code to trace
});

Currently the plan is to automatically instrument these packages to create traces:

Are there any other popular job libraries?

Thanks @zodern! glad to know you’ve been working on this.
We’ve been trying agenda, pulsecron(a fork of agenda), and bullmq (which seems to be most complete solution and our winner)

Well have a go at this as soon as you have it ready then! :slight_smile:

Thanks for the suggestion, but we were trying to avoid creating another visualizer, since the one from monti/kadira is quite convenient with all the times spent on the different parts. Seems like with the latest addition that should be easy to do now :tada:

Fantastic news, @zodern. Looking forward to these updates.

This is great news ! Another package you may want to add to the list : GitHub - msavin/SteveJobs: A simple jobs queue that just works (for Meteor.js)