chore: add telemetry for scrape robots and runs

This commit is contained in:
Rohit Rajan
2025-11-20 19:40:48 +05:30
parent 6477feeaea
commit b2b5a914e7
4 changed files with 51 additions and 3 deletions

View File

@@ -268,6 +268,14 @@ async function processRunExecution(job: Job<ExecuteRunData>) {
logger.log('warn', `Failed to send webhooks for markdown robot run ${data.runId}: ${webhookError.message}`);
}
capture("maxun-oss-run-created-manual", {
runId: data.runId,
user_id: data.userId,
status: "success",
robot_type: "scrape",
formats,
});
await destroyRemoteBrowser(browserId, data.userId);
return { success: true };
@@ -296,6 +304,14 @@ async function processRunExecution(job: Job<ExecuteRunData>) {
logger.log('warn', `Failed to send run-failed notification for markdown robot run ${data.runId}: ${socketError.message}`);
}
capture("maxun-oss-run-created-manual", {
runId: data.runId,
user_id: data.userId,
status: "failed",
robot_type: "scrape",
formats,
});
await destroyRemoteBrowser(browserId, data.userId);
throw error;