If you wish to start a background transaction, use the atatus.startBackgroundTransaction()
function.
Compatibility
Compatible with Node.js agent version 1.x or higher
Syntax
atatus.startBackgroundTransaction(transaction_name)
Parameter
Parameter | Type | Description |
---|---|---|
transaction_name | String (Required) | Transaction name. |
Example
copy
import atatus from "atatus-nodejs";
function generateWeeklyReport() {
atatus.startBackgroundTransaction("Weekly report generation");
// Your code here.
atatus.endTransaction();
}
// Every week Monday morning 01:30 am
new CronJob({
cronTime: '00 30 01 * * 1',
onTick: generateWeeklyReport,
start: false,
timeZone: 'UTC'
}).start();