servicename
This commit is contained in:
parent
a2129ac5ca
commit
24ddf2fe42
|
|
@ -45,14 +45,22 @@ type service struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newService(c *Config) *service {
|
func newService(c *Config) *service {
|
||||||
hostname, _ := os.Hostname()
|
|
||||||
|
hostname := os.Getenv("_POD_NAME")
|
||||||
|
hostip := os.Getenv("_HOST_IP")
|
||||||
|
podip := os.Getenv("_POD_IP")
|
||||||
|
serviceName := os.Getenv("_SERVICE_NAME")
|
||||||
|
|
||||||
|
if hostname == "" {
|
||||||
|
hostname, _ = os.Hostname()
|
||||||
|
}
|
||||||
|
|
||||||
return &service{
|
return &service{
|
||||||
metrics: make(chan *metric, 100000),
|
metrics: make(chan *metric, 100000),
|
||||||
hostname: hostname,
|
hostname: hostname,
|
||||||
serviceName: os.Getenv("SERVICE_NAME"),
|
serviceName: serviceName,
|
||||||
podIp: os.Getenv("POD_IP"),
|
podIp: podip,
|
||||||
hostIp: os.Getenv("HOST_IP"),
|
hostIp: hostip,
|
||||||
config: c,
|
config: c,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue