Skip to content
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

Improve tracking of development instances (resolves #1518) #1519

Merged
merged 4 commits into from
Aug 28, 2020

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented Aug 26, 2020

Changes

This will disable posthoganalytics when DEBUG is truthy, after sending only one event: "development instance launched". The user distinct ID user here is the one of the first user of the first team (presumably the person setting up the instance). The downside is that first there has to be a user, so completely fresh instances with no user yet aren't reported due to lack of distinct ID. Maybe there's a solution to this.

Screen Shot 2020-08-27 at 00 46 34

@Twixes Twixes linked an issue Aug 26, 2020 that may be closed by this pull request
@timgl timgl temporarily deployed to posthog-1518-debug-no-t-yvrwth August 26, 2020 22:54 Inactive
@yakkomajuri
Copy link
Contributor

I quite like this

Copy link
Contributor

@paolodamico paolodamico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be best just to generate a random user ID to be able to capture this before the team is actually created, otherwise we'll lose most of the "development server launched" events as it's likely this code will not run again for a user running a development installation.

@Twixes
Copy link
Member Author

Twixes commented Aug 27, 2020

We could maybe use MAC address as distinct ID as something more-or-less static (either only before a user account is created or always in case of DEBUG instances)?

@paolodamico
Copy link
Contributor

We could maybe use MAC address as distinct ID as something more-or-less static (either only before a user account is created or always in case of DEBUG instances)?

I like that idea, maybe to avoid any privacy concerns, just a hash of the MAC address instead

@Twixes Twixes temporarily deployed to posthog-1518-debug-no-t-yvrwth August 27, 2020 23:45 Inactive
@Twixes
Copy link
Member Author

Twixes commented Aug 27, 2020

Done. Opted for exclusively using MAC address hashed with MD5 when running with DEBUG on, as that should allow us to identify development instances with 99% consistency (the 1% being MAC address changes in the meantime or possibly errors).

@Twixes Twixes temporarily deployed to posthog-1518-debug-no-t-yvrwth August 27, 2020 23:49 Inactive
Copy link
Contributor

@paolodamico paolodamico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@Twixes Twixes merged commit 8c1753c into master Aug 28, 2020
@Twixes Twixes deleted the 1518-debug-no-tracking branch August 28, 2020 00:32
@jamesefhawkins
Copy link
Collaborator

I wondered if we have a sense of how many users have debug = 1 in production (given that PostHog is an internal tool for most people).

With the various deployment methods, does it default into debug = 1 unless users change it?

Just wondered if we may be using a lot of info here.

@Twixes
Copy link
Member Author

Twixes commented Sep 12, 2020

It shouldn't default, so such cases should be rather rare.

@jamesefhawkins
Copy link
Collaborator

Perfect, thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop capturing events on debug instances
5 participants