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

enable metrics by default, and set random user id #2644

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felipemadero
Copy link
Collaborator

@felipemadero felipemadero commented Feb 27, 2025

Why this should be merged

Improve CLI metrics collection

How this works

How this was tested

How is this documented

return true
func getMetricsUserID(app *application.Avalanche) string {
if !app.Conf.ConfigFileExists() || !app.Conf.ConfigValueIsSet(constants.ConfigMetricsUserIDKey) {
userID := utils.RandomString(20)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are we replacing user id?

Current implementation
hash := sha256.Sum256([]byte(codespaceName)) userID = base64.StdEncoding.EncodeToString(hash[:])

SHA 256 is irreversible

Copy link
Collaborator

Choose a reason for hiding this comment

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

and it eliminates the need to check for app config files

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

legal considers this approach, totally independant of user name for id generation, to be the most
beneficial for the purpose cc @javiertc @learyce

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

checking app config file is not too much of an problem IMO

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

Successfully merging this pull request may close these issues.

2 participants