diff --git a/CHANGELOG.md b/CHANGELOG.md index caf493a9435..da4863f78cd 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-3616] ## 0.7.0 (November 1, 2017) diff --git a/command/agent/command.go b/command/agent/command.go index 9966b278cb0..6e6d6a7bb97 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