-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: CDP Internal events processor #27007
base: master
Are you sure you want to change the base?
Conversation
export type HogFunctionTypeType = | ||
| 'destination' | ||
| 'transformation' | ||
| 'internal-destination' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we say that the type would be more specific (e.g. error_tracking_alert
) and just make the Kafka topic generic. I'm easy either way
event: z.object({ | ||
uuid: z.string(), | ||
event: z.string(), | ||
// In this context distinct_id should be whatever we want to use if doing follow up things (like tracking a standard event) | ||
distinct_id: z.string(), | ||
properties: z.record(z.any()), | ||
timestamp: z.string(), | ||
url: z.string().optional(), | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably have a much better grasp on this than me but are we "hacking the system" in any way by reusing the name event here?
When pushing to Kafka we can absolutely use the event
that triggered the error tracking issue to be created as the value for most of these properties but I'm guessing we should be using the issue itself instead. E.g. we should push something like:
...
event: z.object({
uuid: issue.id,
event: "$$error_tracking_issue_created",
distinct_id: uuidv4(),
properties: { name: issue.name, description: issue.description, event: processed_event },
timestamp: issue.created_at,
url: `https://us.posthog.com/error_tracking/${issue.id}`,
}),
The event
within properties
is totally optional but maybe it'd be worth adding
Problem
We want to trigger CDP destinations via "internal events".
This sets up the internal events stream and service to process it.
Changes
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?