appsignal/appsignal-nodejs

Appsignal cannnot be configured via environment variables, in node

Closed this issue · 3 comments

I have the followig environment variables set:

APPSIGNAL_APP_ENV=local
APPSIGNAL_APP_NAME=nwd-api-server
APPSIGNAL_PUSH_API_KEY=secret-guid

I have this in the entrypoint of my program:

const appsignal = new Appsignal({});

When I start my program I get an error (AppSignal not starting, no valid configuration found) telling met that the configuration is invalid.

If i change the entrypoint of my application to

const appsignal = new Appsignal({
    active: true,
    environment: process.env.APPSIGNAL_APP_ENV,
    name: process.env.APPSIGNAL_APP_NAME,
    pushApiKey: process.env.APPSIGNAL_PUSH_API_KEY,
  });

everything works as expected

Hi @elmerbulthuis!

Both ways should work. Could you tell us more about how you're setting the environment variables?

I tested it by setting the environment variables via a launch configuration in vscode.

Hi @elmerbulthuis,

I can confirm that environment variables do work as expected. The issue must lie in how the environment variables are passed from VSCode. Feel free to reach out on support@appsignal.com. Provide a link to this issue.