Skip to content

Commit dd7b020

Browse files
authored
Merge pull request #3616 from hashicorp/b-hostname
Emit hostname as a label
2 parents d7071a0 + 19563c5 commit dd7b020

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ __BACKWARDS INCOMPATIBILITIES:__
44
* config: Nomad no longer parses Atlas configuration stanzas. Atlas has been
55
deprecated since earlier this year. If you have an Atlas stanza in your
66
config file it will have to be removed.
7+
* telemetry: Hostname is now emitted via a tag rather than within the key name.
8+
To maintain old behavior during an upgrade path specify
9+
`backwards_compatible_metrics` in the telemetry configuration.
710

811
IMPROVEMENTS:
912
* core: Allow operators to reload TLS certificate and key files via SIGHUP
@@ -53,6 +56,7 @@ BUG FIXES:
5356
* sentinel: (Nomad Enterprise) Fix an issue that could cause an import error
5457
when multiple Sentinel policies are applied
5558
* telemetry: Do not emit metrics for non-running tasks [GH-3559]
59+
* telemetry: Emit hostname as a tag rather than within the key name [GH-3616]
5660

5761
## 0.7.0 (November 1, 2017)
5862

command/agent/command.go

+5
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,11 @@ func (c *Command) setupTelemetry(config *Config) (*metrics.InmemSink, error) {
654654

655655
metricsConf := metrics.DefaultConfig("nomad")
656656
metricsConf.EnableHostname = !telConfig.DisableHostname
657+
658+
// Prefer the hostname as a label.
659+
metricsConf.EnableHostnameLabel = !telConfig.DisableHostname &&
660+
!telConfig.DisableTaggedMetrics && !telConfig.BackwardsCompatibleMetrics
661+
657662
if telConfig.UseNodeName {
658663
metricsConf.HostName = config.NodeName
659664
metricsConf.EnableHostname = true

0 commit comments

Comments
 (0)