Skip to content

Commit

Permalink
Merge pull request #3616 from hashicorp/b-hostname
Browse files Browse the repository at this point in the history
Emit hostname as a label
  • Loading branch information
dadgar committed Dec 4, 2017
2 parents d7071a0 + 19563c5 commit dd7b020
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
5 changes: 5 additions & 0 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd7b020

Please sign in to comment.