diff --git a/agent.go b/agent.go index 42fe443569a0b..3ba6b69c87f35 100644 --- a/agent.go +++ b/agent.go @@ -46,14 +46,14 @@ func NewAgent(config *Config) (*Agent, error) { } agent.Hostname = hostname + } - if config.Tags == nil { - config.Tags = map[string]string{} - } - - config.Tags["host"] = agent.Hostname + if config.Tags == nil { + config.Tags = map[string]string{} } + config.Tags["host"] = agent.Hostname + return agent, nil }