Configuration

Customize the module behaviour.

As you saw during the installation phase, you pass a configuration object to the Inspector constructor with just the ingestion key:

const inspector = require(@inspector-apm/inspector-nodejs)({
ingestionKey: 'xxxxx'
})

Here are the list of the others parameters that you can use to customize the behaviour of inspector.

enable (boolean)

If desired, you may disable data transfer setting to false the enable configuration option. It could be useful if need to turn on/off monitoring via enviroment files.

{
ingestionKey: 'xxxxx',
enabled: process.env.INSPECTOR_ENABLED||true
}

maxEntries (integer)

Max numebr of items recorded during an execution cycle. 100 by default.

{
ingestionKey: 'xxxxx',
maxEntries: process.env.INSPECTOR_MAX_ENTRIES||500
}

autoWiring (boolean)

By default Inspector automatically detect the modules required in your application to monitoring their interactions.

You can turn off the auto-wiring and set the list of the module to be monitored manually in the "modules" configuration option.

{
ingestionKey: 'xxxxx',
autoWiring: false,
node_modules: [...]
}

modules (Array)

The list of the module that you want take in consideration for your monitoring needs.

{
ingestionKey: 'xxxxx',
autoWiring: false,
node_modules: ['express', 'mysql2', 'mongodb']
}