Skip to content

feat: Add anonymized telemetry to report product usage #2273

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

Merged
merged 11 commits into from
Jun 17, 2022
Merged

Conversation

kylecarbs
Copy link
Member

This adds a background service to report telemetry to a Coder
server for usage data. There will be realtime event data sent
in the future, but for now usage will report on a CRON.

This adds a background service to report telemetry to a Coder
server for usage data. There will be realtime event data sent
in the future, but for now usage will report on a CRON.
@kylecarbs kylecarbs requested a review from coadler June 12, 2022 23:10
@kylecarbs kylecarbs self-assigned this Jun 12, 2022
@@ -0,0 +1,4 @@
CREATE TABLE IF NOT EXISTS site_config (
key varchar(256) NOT NULL UNIQUE,
value varchar(8192) NOT NULL
Copy link
Contributor

Choose a reason for hiding this comment

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

Using jsonb as the value would make it much easier in the future to do migrations on structured data. We've needed to do this a couple times in v1.

emailHashed := ""
atSymbol := strings.LastIndex(dbUser.Email, "@")
if atSymbol >= 0 {
hash := sha256.Sum256([]byte(dbUser.Email[:atSymbol]))
Copy link
Contributor

@coadler coadler Jun 12, 2022

Choose a reason for hiding this comment

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

This hash seems easily reversible tbh. What if we just used {user_id}@domain.com?

Copy link
Member Author

Choose a reason for hiding this comment

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

I want it to be traceable across deployments. We could use a greater hash, but I agree it's still crackable regardless.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah, I forgot about that. This seems reasonable then.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add a comment here for that

@kylecarbs kylecarbs force-pushed the telemetry branch 3 times, most recently from ad19dce to b7b0833 Compare June 13, 2022 01:34
@kylecarbs kylecarbs force-pushed the telemetry branch 2 times, most recently from 79f5490 to 8b1eef8 Compare June 16, 2022 17:08
Copy link
Contributor

@coadler coadler left a comment

Choose a reason for hiding this comment

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

🚀

@kylecarbs kylecarbs force-pushed the telemetry branch 2 times, most recently from af8190a to 61f6c6f Compare June 16, 2022 22:46
@kylecarbs kylecarbs force-pushed the telemetry branch 2 times, most recently from fbc9edf to c333174 Compare June 17, 2022 04:25
@kylecarbs kylecarbs merged commit 4cce969 into main Jun 17, 2022
@kylecarbs kylecarbs deleted the telemetry branch June 17, 2022 05:26
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.

2 participants