From 74ec7096292603671edfa38534b355f79788b563 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Mon, 4 Dec 2017 10:42:31 -0800 Subject: [PATCH 1/2] Emit hostname as a label --- CHANGELOG.md | 4 ++++ command/agent/command.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index caf493a94357..4045e74dc463 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ __BACKWARDS INCOMPATIBILITIES:__ * config: Nomad no longer parses Atlas configuration stanzas. Atlas has been deprecated since earlier this year. If you have an Atlas stanza in your config file it will have to be removed. + * telemetry: Hostname is now emitted via a tag rather than within the key name. + To maintain old behavior during an upgrade path specify + `backwards_compatible_metrics` in the telemetry configuration. IMPROVEMENTS: * core: Allow operators to reload TLS certificate and key files via SIGHUP @@ -53,6 +56,7 @@ BUG FIXES: * sentinel: (Nomad Enterprise) Fix an issue that could cause an import error when multiple Sentinel policies are applied * telemetry: Do not emit metrics for non-running tasks [GH-3559] + * telemetry: Emit hostname as a tag rather than within the key name [GH-XXX] ## 0.7.0 (November 1, 2017) diff --git a/command/agent/command.go b/command/agent/command.go index 9966b278cb08..6e6d6a7bb970 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -654,6 +654,11 @@ func (c *Command) setupTelemetry(config *Config) (*metrics.InmemSink, error) { metricsConf := metrics.DefaultConfig("nomad") metricsConf.EnableHostname = !telConfig.DisableHostname + + // Prefer the hostname as a label. + metricsConf.EnableHostnameLabel = !telConfig.DisableHostname && + !telConfig.DisableTaggedMetrics && !telConfig.BackwardsCompatibleMetrics + if telConfig.UseNodeName { metricsConf.HostName = config.NodeName metricsConf.EnableHostname = true From 19563c5067d130790dfcdc1d4cbe52b5734bbffb Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Mon, 4 Dec 2017 10:43:27 -0800 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4045e74dc463..da4863f78cd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +56,7 @@ BUG FIXES: * sentinel: (Nomad Enterprise) Fix an issue that could cause an import error when multiple Sentinel policies are applied * telemetry: Do not emit metrics for non-running tasks [GH-3559] - * telemetry: Emit hostname as a tag rather than within the key name [GH-XXX] + * telemetry: Emit hostname as a tag rather than within the key name [GH-3616] ## 0.7.0 (November 1, 2017)