Usage events send event_key for deduping event emission retries for the same event - #69610
Usage events send event_key for deduping event emission retries for the same event#69610charlestp wants to merge 2 commits into
Conversation
c36e2fc to
579692e
Compare
| // event_key is a UUID distinguishing one underlying event occurrence, | ||
| // allowing consumers to deduplicate resubmissions. | ||
| // | ||
| // PostHog property: tp.event_key | ||
| string event_key = 128; |
There was a problem hiding this comment.
Is this in sync with cloud's version?
https://github.com/gravitational/cloud/blob/f2e2758344d2547ace065d5d699be0942f448e6b/build/prehog/proto/prehog/v1alpha/teleport.proto#L2202
Can you link the PR here to ensure we keep both protos in sync?
There was a problem hiding this comment.
Not yet. To try to avoid iterations, my plan is to get teleport ready first, then PR cloud, then merge.
There was a problem hiding this comment.
I think we should have both changes approved before merging any.
Let's say that we change teleport emitter but not the receiver part.
And now we try to change the receiver, but cloud's PR receives some back and forth comments and we end up with a different name.
We would need to get back here and change things again.
The process involves updating the Prehog service to handle the new event type, configuring the data warehouse to store the event data, and finally implementing the event emission in Teleport's codebase.
There was a problem hiding this comment.
I'm aware, I wrote that line of the guide 😆
I'm going in reverse order because the implementation in teleport is much more significant than the cloud side. But I'll write my process into an RFD so this doesn't cause more PR churn.
Another fix while implementing DiscoveryConfigChangeEvent. Usage event submission has retry behavior, but no way to dedupe if multiple event submissions end up going through for the same event. This adds an
event_keyto use for deduplication on the backend.Manual Test Plan
Test Environment
Local build.
Test Cases
event_keyis filled when making prehog requests.