Describe the bug
I am facing the following issues while trying to setup the express plugin -
middleware:false does not seem to work./health/check )Plugin settings -
tracer.use('express', {
blacklist: [/.*\/health\/check/],
middleware: false,
});
Screenshots -
middleware still visible in DD monitoring dashboard -

Blacklisted URL is also visible -

Environment
It will be great if someone can guide me on this. 馃檹
Can you share the top of the entry point file where the tracer is imported/initialized? Usually when the configuration is ignored it's because of an ordering issue, for example something being imported before the tracer is initialized. There was however a similar report for the graphql plugin and I'm starting to wonder if there is a regression in the instrumenter. Confirming that the order is correct would help validate that.
@kumaraksi - going to close this out for now, if you have any questions and want to dig further please reach out.
hi @rochdev
i'm facing the same issue right now. you can find the entry file of my service is like this.
these lines are even added before all the imports
'use strict';
const tracer = require('dd-trace').init({
plugins: false,
startupLogs: true,
debug: DD_DEBUG_ENABLED,
runtimeMetrics: DD_RUNTIME_METRICS_ENABLED,
service: DD_SERVICE,
env: DD_ENV,
analytics: true
});
tracer.use('express', {
middleware: false,
blacklist: ['/health/check']
});
// all the imports go after this lines
I have managed to fix it by a very simple change. setting the plugins: false
From what i see is that by default the library is loading the plugins asynchronously which might override the configs for the plugin and setting them to the default ones
below is the code that made it to work
'use strict';
const tracer = require('dd-trace').init({
plugins: false,
startupLogs: true,
debug: DD_DEBUG_ENABLED,
runtimeMetrics: DD_RUNTIME_METRICS_ENABLED,
service: DD_SERVICE,
env: DD_ENV,
analytics: true
});
tracer.use('express', {
plugins: false, // here's the change that made it work
middleware: false,
blacklist: [/.*\/health\/check/] // and this one also
});
// all the imports go after these lines