From 3c3919577138d0f6896ba3dd8042ea48ed769d97 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Wed, 31 Aug 2016 11:19:00 -0700 Subject: [PATCH 1/2] Merging telemetry configs --- CHANGELOG.md | 1 + command/agent/config.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89003f464ee..e49cefcf351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ BUG FIXES: terminal [GH-1508] * agent: Fix advertise address when using IPv6 [GH-1465] * cli: Fix node-status when using IPv6 advertise address [GH-1465] + * client: Merging telemetry configuration properly [GH-1670] * client: Task start errors adhere to restart policy mode [GH-1405] * client: Reregister with servers if node is unregistered [GH-1593] * client: Killing an allocation doesn't cause allocation stats to block diff --git a/command/agent/config.go b/command/agent/config.go index 86686d50a5d..27de7fff920 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -767,6 +767,12 @@ func (a *Telemetry) Merge(b *Telemetry) *Telemetry { if b.collectionInterval != 0 { result.collectionInterval = b.collectionInterval } + if b.PublishNodeMetrics { + result.PublishNodeMetrics = true + } + if b.PublishAllocationMetrics { + result.PublishAllocationMetrics = true + } if b.CirconusAPIToken != "" { result.CirconusAPIToken = b.CirconusAPIToken } From 5e1fdd9784e49c3e69557ada6bed40b17323776e Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Wed, 31 Aug 2016 11:45:46 -0700 Subject: [PATCH 2/2] Added a test --- command/agent/config_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command/agent/config_test.go b/command/agent/config_test.go index 18aefb8b6ff..d83ad140aae 100644 --- a/command/agent/config_test.go +++ b/command/agent/config_test.go @@ -143,6 +143,8 @@ func TestConfig_Merge(t *testing.T) { StatsiteAddr: "127.0.0.2:8125", StatsdAddr: "127.0.0.2:8125", DisableHostname: true, + PublishNodeMetrics: true, + PublishAllocationMetrics: true, CirconusAPIToken: "1", CirconusAPIApp: "nomad", CirconusAPIURL: "https://api.circonus.com/v2",