While I can’t speak for v3 nor the actual configuration of the dd-trace package. For the v4 you should be able to do something like this:
// path: `./src/index.js`
module.exports = {
/**
* An asynchronous register function that runs before
* your application is initialized.
*
* This gives you an opportunity to extend code.
*/
register(/*{ strapi }*/) {
const tracer = require('dd-trace').init({
debug: true,
runtimeMetrics: true,
logInjection: true
});
},
/**
* An asynchronous bootstrap function that runs before
* your application gets started.
*
* This gives you an opportunity to set up your data model,
* run jobs, or perform some special logic.
*/
bootstrap(/*{ strapi }*/) {},
};
At least this is dumping a bunch of debug messages about it being unable to connect to 127.0.0.1:8126 so I assume there is some config you need to do to point it at DataDog
Has anyone else been able to get dd-trace to work for APM metrics in Strapi 4?
In Strapi 3 I had it working with a simple require(“dd-trace”).init(); at the top of the bootstrap.js file, but the code above in src/index.js in register() in Strapi 4 doesn’t seem to be working