Skip to content

Commit

Permalink
Merge pull request #4128 from hashicorp/b-uptime
Browse files Browse the repository at this point in the history
Fix client uptime metric missing client prefix
  • Loading branch information
dadgar committed Apr 10, 2018
2 parents 06412a5 + ba31db0 commit 3407242
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
22 changes: 15 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,28 @@
__BACKWARDS INCOMPATIBILITIES:__
* cli: node drain now blocks until the drain completes and all allocations on
the draining node have stopped. Use -detach for the old behavior.
* client: Periods (`.`) are no longer replaced with underscores (`_`) in
environment variables as many applications rely on periods in environment
variable names. [[GH-3760](https://github.com/hashicorp/nomad/issues/3760)]
* client/metrics: The key emitted for tracking a client's uptime has changed
from "uptime" to "client.uptime". Users monitoring this metric will have to
switch to the new key name [[GH-4128](https://github.com/hashicorp/nomad/issues/4128)]
* discovery: Prevent absolute URLs in check paths. The documentation indicated
that absolute URLs are not allowed, but it was not enforced. Absolute URLs
in HTTP check paths will now fail to validate. [[GH-3685](https://github.com/hashicorp/nomad/issues/3685)]
* drain: Draining a node no longer stops all allocations immediately: a new
[migrate stanza](https://www.nomadproject.io/docs/job-specification/migrate.html)
allows jobs to specify how quickly task groups can be drained. A `-force`
option can be used to emulate the old drain behavior.
* jobspec: The default values for restart policy have changed. Restart policy mode defaults to "fail" and the
attempts/time interval values have been changed to enable faster server side rescheduling. See
[restart stanza](https://www.nomadproject.io/docs/job-specification/restart.html) for more information.
* jobspec: Removed compatibility code that migrated pre Nomad 0.6.0 Update stanza syntax. All job spec files should be using update stanza fields introduced in 0.7.0 [[GH-3979](https://github.com/hashicorp/nomad/pull/3979/files)]
* client: Periods (`.`) are no longer replaced with underscores (`_`) in
environment variables as many applications rely on periods in environment
variable names. [[GH-3760](https://github.com/hashicorp/nomad/issues/3760)]
* jobspec: The default values for restart policy have changed. Restart policy
mode defaults to "fail" and the attempts/time interval values have been
changed to enable faster server side rescheduling. See [restart
stanza](https://www.nomadproject.io/docs/job-specification/restart.html) for
more information.
* jobspec: Removed compatibility code that migrated pre Nomad 0.6.0 Update
stanza syntax. All job spec files should be using update stanza fields
introduced in 0.7.0
[[GH-3979](https://github.com/hashicorp/nomad/pull/3979/files)]

IMPROVEMENTS:
* core: Servers can now service client HTTP endpoints [[GH-3892](https://github.com/hashicorp/nomad/issues/3892)]
Expand Down
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2334,10 +2334,10 @@ func (c *Client) setGaugeForAllocationStats(nodeID string) {
// No labels are required so we emit with only a key/value syntax
func (c *Client) setGaugeForUptime(hStats *stats.HostStats) {
if !c.config.DisableTaggedMetrics {
metrics.SetGaugeWithLabels([]string{"uptime"}, float32(hStats.Uptime), c.baseLabels)
metrics.SetGaugeWithLabels([]string{"client", "uptime"}, float32(hStats.Uptime), c.baseLabels)
}
if c.config.BackwardsCompatibleMetrics {
metrics.SetGauge([]string{"uptime"}, float32(hStats.Uptime))
metrics.SetGauge([]string{"client", "uptime"}, float32(hStats.Uptime))
}
}

Expand Down

0 comments on commit 3407242

Please sign in to comment.