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: remove unnecessary error from payload #703

Closed
casperdcl opened this issue Oct 26, 2022 · 0 comments · Fixed by #704
Closed

telemetry: remove unnecessary error from payload #703

casperdcl opened this issue Oct 26, 2022 · 0 comments · Fixed by #704
Assignees
Labels
bug Something isn't working technical-debt Refactoring, linting & tidying

Comments

@casperdcl
Copy link
Contributor

casperdcl commented Oct 26, 2022

Same as iterative/cml#1236

err := ""
if e != nil {
err = reflect.TypeOf(e).String()
}
userId, uErr := UserId()
if uErr != nil {
return nil, uErr
}
groupId, gErr := GroupId()
if gErr != nil {
return nil, gErr
}
tfVer, tfVerErr := TerraformVersion()
if tfVerErr != nil {
return nil, tfVerErr
}
extra["ci"] = guessCI()
extra["terraform_version"] = tfVer
payload := map[string]interface{}{
"user_id": userId,
"group_id": groupId,
"action": action,
"interface": "cli",
"tool_name": "tpi",
"tool_source": "terraform",
"tool_version": Version,
"os_name": systemInfo["os_name"],
"os_version": systemInfo["platform_version"],
"backend": extra["cloud"],
"error": err,
"extra": extra,
}

instead logic should be:

 if e != nil { 
 	payload["error"] = reflect.TypeOf(e).String()
 } // otherwise, "error" should not appear in payload
@casperdcl casperdcl added bug Something isn't working technical-debt Refactoring, linting & tidying labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working technical-debt Refactoring, linting & tidying
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants