The setAnalyticsSkip
function helps you exclude specific API requests (such as health-related requests) from being sent to Atatus.
Compatibility
Requires Node.js agent version 1.6.1 or higher.
Syntax
atatus.setAnalyticsSkip(fn)
Parameter
Parameter | Type | Description |
---|---|---|
fn | Function (Required) | Skip any requests from being monitored in Analytics |
Example
copy
import atatus from "atatus-nodejs";
atatus.setAnalyticsSkip((event) => {
// Skip certain transactions
if (event.name === 'GET /health' || event.name === 'POST /cron/report') {
return true;
}
// Skip content type text/html
if (event.responseHeaders['content-type'].includes('text/html')) {
return true;
}
return false;
});