racker/gutsy — pull request #44 by philk (2012-03-06 23:06:52+00:00)
Title: NewRelic Middleware

Here's my attempt at a NewRelic middleware. A couple problems along the way.

- I have no idea how to integrate with the tests. For the [newrelicapi][1] module I'm using [nock][2] so I don't have to have any test specific code in my real code. This may mean it's easier to just rewrite the newrelic middleware in the request_maker style of gutsy instead of being using a more general library. I don't know how scalable hand-writing a middleware for every API will be, some APIs are hard.

- I'm just grabbing the basic summary metrics and not any specific metrics. We might want to add a real subpage where you can select from a list of all the metrics.

- Putting the apikey and accountId in plain text in the devops.json file seems really icky. Is that really the plan? With a NewRelic apikey and accountId you could add or delete applications (and thus all of our history), post deployment notices (not dangerous, just annoying), or of course view any of our metric data.

[1]: https://github.com/philk/node-newrelicapi
[2]: https://github.com/flatiron/nock