servicename
This commit is contained in:
parent
a2129ac5ca
commit
24ddf2fe42
|
|
@ -45,14 +45,22 @@ type service struct {
|
|||
}
|
||||
|
||||
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{
|
||||
metrics: make(chan *metric, 100000),
|
||||
hostname: hostname,
|
||||
serviceName: os.Getenv("SERVICE_NAME"),
|
||||
podIp: os.Getenv("POD_IP"),
|
||||
hostIp: os.Getenv("HOST_IP"),
|
||||
serviceName: serviceName,
|
||||
podIp: podip,
|
||||
hostIp: hostip,
|
||||
config: c,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue