Add the host tag always. Fixes #4
This commit is contained in:
12
agent.go
12
agent.go
@@ -46,14 +46,14 @@ func NewAgent(config *Config) (*Agent, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
agent.Hostname = hostname
|
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
|
return agent, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user