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 Koa Support #113

Closed
danhstevens opened this issue Feb 3, 2014 · 5 comments
Closed

Add Koa Support #113

danhstevens opened this issue Feb 3, 2014 · 5 comments

Comments

@danhstevens
Copy link

Support for the Koa Framework, which is created by the team behind Express, would be awesome since it's gaining a lot of popularity. I've tried including node-newrelic in my Koa project and get the following error:

The New Relic Node.js agent was unable to start due to an error:
TypeError: callbacks argument must be an object
  at createAsyncListener (node.js:536:15)
  at process.addAsyncListener (node.js:548:21)
  ...

Any work around for this would be a great help!

@othiym23
Copy link
Contributor

othiym23 commented Feb 3, 2014

There's actually two things going on here:

  1. Node v0.11.11 uses a version of the asyncListener API that's incompatible with the version in v0.11.10 (and provided by the async-listener polyfill for v0.11.9 and earlier). This module depends on node-continuation-local-storage, which uses the asyncListener API, so until that's caught up with Node master, New Relic for Node is broken on Node v0.11.11 and newer. It should be fixed in the next version of this module, but until then, Node v0.11.10 or earlier will work. This part is a duplicate of Agent failed to start. From the error code it looks like due to missing callback #112.
  2. New Relic for Node.js has instrumentation for a relatively small number of web frameworks (Express, Restify, and Hapi), chosen for their popularity. The team working on the module is small, and our to-do list is long. If you want to see support added for a new framework, I suggest you open a ticket with [email protected] so our product management team can assess the demand for new features and prioritize accordingly.

That said, Koa's still an experimental module, and it's likely that New Relic support for anything that relies upon language features hidden behind the --harmony flags is likely to be limited for the foreseeable future. Much of V8's ES6 implementation is incomplete or incorrect, and while the generators implementation is mostly correct, it's still subject to change until the ES6 specification moves from draft to standard, later this year. See nodejs/node-v0.x-archive#6999 for a fuller discussion of ES6 features and my stance on supporting them for New Relic.

@othiym23 othiym23 closed this as completed Feb 3, 2014
@hallas
Copy link

hallas commented Mar 1, 2014

@othiym23 How about some pointers on how we should go about implementing this in a seperate project? Is noticeError and naming the transactions sufficient?

@othiym23
Copy link
Contributor

othiym23 commented Mar 1, 2014

Probably, although you probably don't even need api.noticeError, as the error-noticing code lives in the asyncListener handler used by CLS. If you write a middleware function that names the transaction, that should be enough to get you most of the way there.

@rickharrison
Copy link

How does new relic tie the transaction to the current http request/response? I am calling newrelic.setTransactionName, but the only thing showing up on the dashboard is /*

@txase
Copy link

txase commented Aug 13, 2014

@rickharrison

It sounds like you have an unrelated problem. We are also in the process of closing down our use of GitHub issues. Please follow up on your issue at http://support.newrelic.com. We can provide better support through our dedicated portal than we have been able to provide here on github.

Thanks!

@newrelic newrelic locked and limited conversation to collaborators Aug 13, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants