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

Issue with seneca-id header #159

Open
bernitorres opened this issue Dec 4, 2017 · 0 comments
Open

Issue with seneca-id header #159

bernitorres opened this issue Dec 4, 2017 · 0 comments
Assignees

Comments

@bernitorres
Copy link

I added a new relic plugin to my seneca microservice, so requests can be logged with a name that makes sense instead of being grouped under /*. After adding this plugin, requests started to fail with the following error:

"notice":"seneca: Action role:movements failed: \"value\" required in setHeader(\"seneca-id\", value).","code":"act_execute","err":

This is the wrapper:

const newrelic = require('newrelic');
const _ = require('lodash');

module.exports = function logger() {
  const seneca = this;
  seneca.wrap('role:*', function wrapper(msg, respond) {
    newrelic.setTransactionName(`role:${msg.role}, cmd:${msg.cmd}`);
    this.prior(msg, respond);
  });
};

Usage of the plugin:
this.seneca.use(newRelicPlugin);

What could be causing the seneca-id header to disappear? Is it because of the wrap function? Is there a better way to do this?

@rjrodger rjrodger self-assigned this Feb 16, 2019
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

2 participants