// Path to the Atatus profiling agent
const profilerWrapper = require('@atatus/atatus-profiling-agent');
const profconfig = {
service: 'Your_service_name',
version: '1.0.0',
env: 'prod',
apiKey: 'Your_license_key'
tags: ["us-east1"],
profiling: { enabled: true },
logger: {
debug: (msg, ...args) => console.debug(msg, ...args),
info: (msg, ...args) => console.info(msg, ...args),
warn: (msg, ...args) => console.warn(msg, ...args),
error: (msg, ...args) => console.error(msg, ...args),
}
};
// Starts the Atatus profiling agent
profilerWrapper.start(profconfig);
// Stop profiler on exit
process.on('SIGINT', () => {
console.log('Stopping profiler...');
profilerWrapper.stop();
clearInterval(workload);
// Optional: forcefully exit after a few seconds if uploads get stuck
setTimeout(() => process.exit(), 5000).unref();
});