Strange transaction names in New Relic for a Sails.js app

I just integrated New Relic with my Sails project, and the transactions list is looking like this:

Each item, on top of having a bunch of asterisks prepended to it, is repeating the path twice or more. e.g. that first one should just read “post /noo/seed”.

Will, did you notice anything like that happening to your project?

Alexis, is there any documentation you could point me to so I could start figuring out where this behavior happens? I could just dive into the newrelic module code, of course, but pointers are always appreciated :slight_smile:

1 Like

Hey @lwang, sorry that we didn’t get back to you on this sooner! Are you still seeing these? One thing you could try is looking at your Node.js agent log (set to trace level while you investigate) to see what’s causing this naming behavior, if anything.

In general, this documentation is a good guide on how the agent names transactions, and might give you a good idea for a cause or solution: https://github.com/newrelic/node-newrelic#transactions-and-request-naming

1 Like

@alexis Thanks for the link. I was having the same exact issue. In the documentation it said to ask for new newrelic to officially support new frameworks. Sails support would be great!

@lwang I’m guessing you arrived at the same conclusion I did already but for other people reading this thread require newrelic in your sails controller file and put newrelic.setControllerName(name, [action]) right inside your controller methods. Such as:

// FooController.js
module.exports = {
    foo: function (req, res) {
        newrelic.setControllerName('FooController', 'foo');
        // ...
    }
};
1 Like

Thank you for the awesome help, @dylanbathurst - I will also send your Sails.js FR off to our product managers. :slight_smile:

1 Like

@lwang and @dylanbathurst we were looking into this, found that sails.js was still on express 3. We investigated how route naming like this could happen in express 3 and found a bug. This is fixed as of 1.17.3: https://docs.newrelic.com/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-1173

1 Like