PostHog / plugin-server

Service to process and save PostHog events, supporting JS/TS plugins at that
https://posthog.com
8 stars 5 forks source link

Silence distinct ID conflict Sentry errors #609

Closed yakkomajuri closed 3 years ago

yakkomajuri commented 3 years ago

Changes

I added this bit of error logging to help debug some things in the past but now it leads to Sentry spamming due to a very normal event (distinct id conflicts).

https://sentry.io/organizations/posthog/issues/2454986618/?project=5592816&query=is%3Aunresolved&statsPeriod=14d

Checklist

tiina303 commented 3 years ago

Could you elaborate on why distinct ID conflicts are normal and should be ignored?

yakkomajuri commented 3 years ago

More often than not a person's events come in batches. Most people use PostHog on the frontend, and so in a second I'm already getting pageviews, snapshots, etc from a person.

Thus, we're very likely to be processing an event from a person that does not exist in parallel. As such, one thread creates the distinct ID mapping, and the other then fails to insert because of that constraint.