Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(cdp): Log non-UUID personId values arriving at cyclotron-v2 queue (#57964)

Daniel Marchuk4fff2c8fab74
diff --git a/nodejs/src/cdp/services/cyclotron-v2/manager.ts b/nodejs/src/cdp/services/cyclotron-v2/manager.ts
index 035d5fbee723..31bccc1b8e27 100644
--- a/nodejs/src/cdp/services/cyclotron-v2/manager.ts
+++ b/nodejs/src/cdp/services/cyclotron-v2/manager.ts
@@ -1,9 +1,33 @@
import { Pool } from 'pg'
-import { v7 as uuidv7 } from 'uuid'
+import { v7 as uuidv7, validate as validateUuid } from 'uuid'
import { logger } from '../../../utils/logger'
import { CyclotronV2JobInit, CyclotronV2JobInitSchema, CyclotronV2ManagerConfig } from './types'
+// Diagnostic helper: surface non-UUID personId values arriving at the queue so we can trace
+// which producer is sending them. The schema silently coerces these to null; this log gives
+// us the value plus job context (team, function, queue) we need to root-cause the source.
+// The whole body is wrapped in try/catch so diagnostic logging can never break the job-create path.
+function logNonUuidPersonId(input: CyclotronV2JobInit): void {
+ try {
+ if (typeof input.personId !== 'string') {
+ return
+ }
+ if (validateUuid(input.personId)) {
+ return
+ }
+ logger.warn('Non-UUID personId on cyclotron-v2 job, will be coerced to null', {
+ teamId: input.teamId,
+ functionId: input.functionId ?? null,
+ queueName: input.queueName,
+ parentRunId: input.parentRunId ?? null,
+ personId: input.personId,
+ })
+ } catch {
+ // Diagnostic logging must never break the job-create path.
+ }
+}
+
export class CyclotronV2Manager {
private pool: Pool
private readonly depthLimit: number
@@ -27,6 +51,7 @@ export class CyclotronV2Manager {
}
async createJob(input: CyclotronV2JobInit): Promise<string> {
+ logNonUuidPersonId(input)
const job = CyclotronV2JobInitSchema.parse(input)
await this.insertGuard()
@@ -63,6 +88,10 @@ export class CyclotronV2Manager {
return []
}
+ for (const input of inputs) {
+ logNonUuidPersonId(input)
+ }
+
const jobs = inputs.map((input) => CyclotronV2JobInitSchema.parse(input))
await this.insertGuard()