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

add APM API #47

Open
yoshuawuyts opened this issue Jan 14, 2017 · 9 comments
Open

add APM API #47

yoshuawuyts opened this issue Jan 14, 2017 · 9 comments

Comments

@yoshuawuyts
Copy link
Collaborator

It'd be cool if we could plug in opbeat and the like without too much hassle. I'm quite convinced we can do without a lot of the monkey patching their default package has because we use streams + already catch all uncaught errors - having a proper plugin system would allow for seamless integration with monitoring providers (:

cc/ @watson @roncohen - thoughts? This'd be super neat to have I think (:

@roncohen
Copy link

I'll let @watson comment on the details, but I think it would be relatively easy to do.

If route names were available to middlewares, it could be as simple as a one-line middleware that calls this: https://opbeat.com/docs/articles/opbeat-for-nodejs-api/#settransactionname

@lrlna
Copy link
Member

lrlna commented Jan 14, 2017

If route names were available to middlewares

hell ya, req.url should get that for us and we would be all set; nice!

@watson
Copy link

watson commented Jan 14, 2017

All Opbeat need to know is the name of the route (with name I mean /user/:id as opposed to /user/42).

So if you expose the route name in some easy to get way then we can use that.

What we usually find that we need to do is hook into the framework to get access to the matched route name in some way. Here's an example of how we do this with the koa-router module: https://github.com/opbeat/opbeat-node/blob/master/lib/instrumentation/modules/koa-router.js

@watson
Copy link

watson commented Jan 14, 2017

I've been looking over merry, server-router and wayfarer now and can't seem to find a place where this string is accessible. If it ins't, would you consider exposing it in someway? Beside being used by Opbeat, this would be convenient to have for logging purposes as well.

@lrlna
Copy link
Member

lrlna commented Jan 14, 2017 via email

@watson
Copy link

watson commented Jan 14, 2017

Yeah, the route name. If that could be exposed we'd have full support 😄 Here's an explanation: https://opbeat.com/docs/articles/get-started-with-a-custom-nodejs-stack/#route-naming

@watson
Copy link

watson commented Jan 14, 2017

I guess the Trie.prototype.match function needed to be modified. But I only spend a few minutes looking over it, so I'm not sure if there's a better spot

@yoshuawuyts
Copy link
Collaborator Author

@yoshuawuyts
Copy link
Collaborator Author

MongoDB exposes an APM API; we should do something similar so instrumentation vendors have a better time instrumenting merry apps! 🎉

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

4 participants