Add versioned telemetry events

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-04-03 07:32:54 -05:00
parent 2ac40aba56
commit 37b6ad42ea
16 changed files with 577 additions and 0 deletions

View file

@ -31,8 +31,10 @@ import {
stringifyRoutineVariableValue,
syncRoutineVariablesWithTemplate,
} from "@paperclipai/shared";
import { trackRoutineRun } from "@paperclipai/shared/telemetry";
import { conflict, forbidden, notFound, unauthorized, unprocessable } from "../errors.js";
import { logger } from "../middleware/logger.js";
import { getTelemetryClient } from "../telemetry.js";
import { issueService } from "./issues.js";
import { secretService } from "./secrets.js";
import { parseCron, validateCron } from "./cron.js";
@ -856,6 +858,14 @@ export function routineService(db: Db, deps: { heartbeat?: IssueAssignmentWakeup
}
}
const telemetryClient = getTelemetryClient();
if (telemetryClient) {
trackRoutineRun(telemetryClient, {
source: run.source,
status: run.status,
});
}
return run;
}