Skip to content

Commit cd4f7ea

Browse files
authored
Update hostname remotely (#18)
1 parent 012b1ff commit cd4f7ea

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

config/config.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,14 @@ func readRemoteList(
488488
logger.Warn("Region name not provided in config file")
489489
}
490490

491-
glRC.HostName, _ = GetHostname(logger)
491+
glRC.HostName = strings.ToLower(c.Local.HostName)
492+
if glRC.HostName == "" {
493+
logger.Debug("Hostname not provided in config file")
494+
glRC.HostName, _ = GetHostname(logger)
495+
} else {
496+
logger.Info("Remotely assigned hostname for metrics uploading",
497+
zap.String("metrics_hostname", glRC.HostName))
498+
}
492499

493500
glRC.InterfaceName = strings.ToLower(c.Local.InterfaceName)
494501
switch {

example_run_arachne_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/uber/arachne/metrics"
2727
)
2828

29-
func ExampleRunArachne() {
29+
func ExampleRun() {
3030

3131
mc := new(metrics.StatsdConfiger)
3232

0 commit comments

Comments
 (0)