Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit hostname as a label #3616

Merged
merged 2 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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