Skip to content

Commit c4cb3db

Browse files
committed
feat: track infralens scan completions via vercel analytics
- fire a custom "infralens_scan_completed" event from the run-checks server action on successful scans, to distinguish real tool usage from page views in web analytics
1 parent 5519948 commit c4cb3db

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎app/tools/infralens/actions/run-checks.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { logWarn } from "@infralens-lib/log";
99
import { isSecurityError } from "@infralens-lib/security/errors";
1010
import { resolveValidatedTarget } from "@infralens-lib/security/resolve-target";
1111
import { normalizeTarget } from "@infralens-lib/security/target";
12+
import { track } from "@vercel/analytics/server";
1213
import { headers } from "next/headers";
1314

1415
// Returned instead of thrown for every expected rejection (rate limit,
@@ -72,5 +73,7 @@ export async function runInfraChecks(
7273
timeout: CHECK_TIMEOUT_MS,
7374
});
7475

76+
await track("infralens_scan_completed");
77+
7578
return { ok: true, data: response };
7679
}

0 commit comments

Comments
 (0)