Skip to content

Commit

Permalink
Merge pull request #293 from newrelic/rename_nri_host_id
Browse files Browse the repository at this point in the history
rename HOST_ID into NRI_HOST_ID for unification
  • Loading branch information
brushknight authored Mar 22, 2022
2 parents 132408d + b062b90 commit 8773154
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion args/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type DefaultArgumentList struct {
Metadata bool `default:"false" help:"Add customer defined key-value attributes to the samples."`
NriCluster string `default:"" help:"Optional. Cluster name"`
NriService string `default:"" help:"Optional. Service name"`
HostID string `default:"" help:"Optional. Host ID to be set in entity or/and in the payload"`
NriHostID string `default:"" help:"Optional. Host ID to be set in entity or/and in the payload"`
}

// All returns if all data should be published
Expand Down
4 changes: 2 additions & 2 deletions integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ func (i *Integration) MarshalJSON() (output []byte, err error) {
return
}

// GetHostID returns HostID or an empty string if not set
// GetHostID returns NriHostID or an empty string if not set
func (i *Integration) GetHostID() string {
defaultArgs := args.GetDefaultArgs(i.args)
return defaultArgs.HostID
return defaultArgs.NriHostID
}

// toJSON serializes integration as JSON. If the pretty attribute is
Expand Down
4 changes: 2 additions & 2 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,11 @@ func Test_Integration_HostId(t *testing.T) {
},
}

_ = os.Setenv("HOST_ID", "id-1234567890abc")
_ = os.Setenv("NRI_HOST_ID", "id-1234567890abc")

// os.ClearEnv breaks tests in Windows that use the fileStorer because clears the user env vars
defer func() {
_ = os.Unsetenv("HOST_ID")
_ = os.Unsetenv("NRI_HOST_ID")
}()

i, err := New("TestIntegration", "1.0", Logger(log.Discard), Writer(w), Args(&arguments))
Expand Down

0 comments on commit 8773154

Please sign in to comment.