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

Fix client uptime metric missing client prefix #4128

Merged
merged 2 commits into from
Apr 10, 2018
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
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