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

Telemetry (turn off with DO_NOT_TRACK env var) #671

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Conversation

sourishkrout
Copy link
Member

Introducing anonymous telemetry that respects common ENV var DO_NOT_TRACK=true or DO_NOT_TRACK=1.

Copy link

sonarcloud bot commented Sep 19, 2024

@sourishkrout sourishkrout merged commit ca6efae into main Sep 19, 2024
7 checks passed
@sourishkrout sourishkrout deleted the seb/scarf branch September 19, 2024 23:44

// Returns true if telemetry reporting is enabled, false otherwise.
func ReportUnlessNoTracking(logger *zap.Logger) bool {
if v := os.Getenv("DO_NOT_TRACK"); v != "" && v != "0" && v != "false" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I really like strconv.ParseBool's semantic which takes into account sane values and converts them to boolean.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point 👌.

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