Skip to content

Commit

Permalink
Fix remote backend tracking (#1218)
Browse files Browse the repository at this point in the history
Previously we would submit an empty backend if the configuration used the default value. This detects an empty value and uses the default "app.terraform.io" value instead.
  • Loading branch information
jpogran authored Mar 20, 2023
1 parent 42c918e commit 20aa24e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/langserver/handlers/hooks_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ func moduleTelemetryData(mod *state.Module, ch state.ModuleChanges, store *state
if data, ok := mod.Meta.Backend.Data.(*backend.Remote); ok {
hostname := data.Hostname

// https://developer.hashicorp.com/terraform/language/settings/backends/remote#hostname
// Defaults to app.terraform.io for Terraform Cloud
if hostname == "" {
hostname = "app.terraform.io"
}

// anonymize any non-default hostnames
if hostname != "" && hostname != "app.terraform.io" {
if hostname != "app.terraform.io" {
hostname = "custom-hostname"
}

Expand Down

0 comments on commit 20aa24e

Please sign in to comment.