Meteor APM release

Almost one year ago I have announced that I am developing meteor apm.

Today I am glad to announce Meteor elastic package is production ready. I have published 2.0.0 version today which is completely refactored to be more understandable and testable.

GitHub Repo: https://github.com/kschingiz/meteor-elastic-apm
atmosphere package: https://atmospherejs.com/kschingiz/meteor-elastic-apm

New version include these changes:

  1. Use shimmer.js for safe monkey patching
  2. Async, db tracks bug fixes.
  3. Code is eslinted with prettier.
  4. Unit tests, code coverage > 90%
  5. Travis CI
  6. Removed oplog stats from apm
  7. Update elastic nodejs agent to the latest version (2.0.0)

Roadmap:

  1. Documentation
  2. Add custom metrics (pub/sub count, meteor calls count, auth count, etc…)
  3. Integration tests

Thanks for your feedback and PRs.

20 Likes
2 Likes

@storyteller Thanks! I forgot to include repo and atmosphere urls :face_with_hand_over_mouth:

1 Like

Hey, this sounds great. I’ve never used Elastic but it looks very comprehensive. So if we were to open an Elastic Cloud account and install your agent package we’re good to go ?

We didn’t see any client code… do you also have plans to catch client errors ?

1 Like

@marklynch
Yes you can open elastic cloud account and use the package. Easy.

meteor apm works only in server, I don’t have plans to catch client side events, because it was already done by Elastic Team, see apm-agent-rum-js

But I don’t know yet apm-agent-rum-js compatibility with Meteor, as I didn’t tested it in Meteor environment, if it does not support Meteor exceptions, maybe I will add client side instrumentation for Meteor.

If you test rum agent, let me know how it’s working with Meteor.

Thanks!

2 Likes

Right, that looks perfect. The only two things I guess we’d need to do are

  • Hook into Meteor._debug to get all the exceptions. This is pretty easy.
  • Upload the sourcemaps in production. I see they have an API for this, and I believe we can follow @zodern’s code from his agent to see how to do it.

I’ll try and find some time to test drive the server side first and if we like that then I’ll definitely try get the client-side agent working.

1 Like

Thanks for your ideas!

  1. I will add Meteor._debug to the roadmap
  2. I think @zodern source maps support is generic, and it’s not built only for Kadira purposes. you can try:
meteor add zodern:standard-minifier-js
meteor add zodern:hide-production-sourcemaps

And see how it works in your app.

I don’t think this is needed because Meteor does not minify server side code.

1 Like

So I just tried it briefly. It’s a bit overwhelming at first with all the options but just focusing on the APM part it’s pretty easy to use. Overall it looks quite promising although I’ve used Kadira for so long there’s a few things I noticed that could be improved.

Within traces of methods/pubs, so for individual finds, findOnes, fetches etc. Kadira has a lot of info which is vital to debugging an issue, like the parameters to each call. Should these be tags within the span ? I see you’ve added the params for the main call to the method or publication in the custom tab.

I also caused an exception by calling a method with dummy params and in the error report it didn’t have these params (it actually had another value which it shouldn’t have had).

Anyway, it’s looking good :+1: If you’d prefer to track these in github issues let me know.

1 Like

Yes, @marklynch please submit github issues with steps of reproduction, I will take a look and fix as soon as possible.

Thanks!

2 Likes

@marklynch and everybody who is interested in this package.
There is big update coming in this branch: https://github.com/kschingiz/meteor-elastic-apm/tree/trace_improvements
Changelogs:

  1. Merge nested async spans into one (Done)
  2. DB spans have selector, document, docs fetched, docs removed, docs updated, doc id inserted, options data (Done)
  3. Meteor methods trace improvements: method transaction will have response, exception (if error is thrown) and method params data (Done)
  4. Cursor methods: options, docs fetched, what is returned from cursor (Done)
  5. Subscriptions improvements: sub params, docs fetched (In progress)
  6. User id data in transactions (Done)
  7. Http requests: http request data, response data, response code, etc… (In progress)
  8. Fix async meteor collection method execution when callback is provided (Done)

New release is planned for the next week (maybe at the end of the week) when I implement some new features and fix tests.

Stay tuned, enjoy using it and feel free to contribute.

6 Likes

Hi everybody I have published today new version 2.1.1:

  1. Merge nested async spans into one
  2. DB spans have selector, document, docs fetched, docs removed, docs updated, doc id inserted, options data
  3. Meteor methods trace improvements: method transaction will have response, exception (if error is thrown) and method params data
  4. Cursor methods: options, docs fetched, what is returned from cursor
  5. Subscriptions improvements: sub params, docs fetched
  6. User id data in transactions
  7. Fix async meteor collection method execution when callback is provided
  8. Update readme, screenshots
  9. Tests code coverage is increased to be 93%
10 Likes

Nice! Thanks!:+1:

Screenshot_1

@kschingiz, thanks for maintaining this. We are currently using this and has helped us a lot.

Recently, we started using Meteor.defer() to speed up client responses for cases that we do not need to wait for a call. But because of this, we are no longer seeing these calls in APM. Any idea how can we use defer but still track the calls?