Skip to content

Commit 3407242

Browse files
authored
Merge pull request #4128 from hashicorp/b-uptime
Fix client uptime metric missing client prefix
2 parents 06412a5 + ba31db0 commit 3407242

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

CHANGELOG.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,28 @@
33
__BACKWARDS INCOMPATIBILITIES:__
44
* cli: node drain now blocks until the drain completes and all allocations on
55
the draining node have stopped. Use -detach for the old behavior.
6+
* client: Periods (`.`) are no longer replaced with underscores (`_`) in
7+
environment variables as many applications rely on periods in environment
8+
variable names. [[GH-3760](https://github.com/hashicorp/nomad/issues/3760)]
9+
* client/metrics: The key emitted for tracking a client's uptime has changed
10+
from "uptime" to "client.uptime". Users monitoring this metric will have to
11+
switch to the new key name [[GH-4128](https://github.com/hashicorp/nomad/issues/4128)]
612
* discovery: Prevent absolute URLs in check paths. The documentation indicated
713
that absolute URLs are not allowed, but it was not enforced. Absolute URLs
814
in HTTP check paths will now fail to validate. [[GH-3685](https://github.com/hashicorp/nomad/issues/3685)]
915
* drain: Draining a node no longer stops all allocations immediately: a new
1016
[migrate stanza](https://www.nomadproject.io/docs/job-specification/migrate.html)
1117
allows jobs to specify how quickly task groups can be drained. A `-force`
1218
option can be used to emulate the old drain behavior.
13-
* jobspec: The default values for restart policy have changed. Restart policy mode defaults to "fail" and the
14-
attempts/time interval values have been changed to enable faster server side rescheduling. See
15-
[restart stanza](https://www.nomadproject.io/docs/job-specification/restart.html) for more information.
16-
* 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)]
17-
* client: Periods (`.`) are no longer replaced with underscores (`_`) in
18-
environment variables as many applications rely on periods in environment
19-
variable names. [[GH-3760](https://github.com/hashicorp/nomad/issues/3760)]
19+
* jobspec: The default values for restart policy have changed. Restart policy
20+
mode defaults to "fail" and the attempts/time interval values have been
21+
changed to enable faster server side rescheduling. See [restart
22+
stanza](https://www.nomadproject.io/docs/job-specification/restart.html) for
23+
more information.
24+
* jobspec: Removed compatibility code that migrated pre Nomad 0.6.0 Update
25+
stanza syntax. All job spec files should be using update stanza fields
26+
introduced in 0.7.0
27+
[[GH-3979](https://github.com/hashicorp/nomad/pull/3979/files)]
2028

2129
IMPROVEMENTS:
2230
* core: Servers can now service client HTTP endpoints [[GH-3892](https://github.com/hashicorp/nomad/issues/3892)]

client/client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2334,10 +2334,10 @@ func (c *Client) setGaugeForAllocationStats(nodeID string) {
23342334
// No labels are required so we emit with only a key/value syntax
23352335
func (c *Client) setGaugeForUptime(hStats *stats.HostStats) {
23362336
if !c.config.DisableTaggedMetrics {
2337-
metrics.SetGaugeWithLabels([]string{"uptime"}, float32(hStats.Uptime), c.baseLabels)
2337+
metrics.SetGaugeWithLabels([]string{"client", "uptime"}, float32(hStats.Uptime), c.baseLabels)
23382338
}
23392339
if c.config.BackwardsCompatibleMetrics {
2340-
metrics.SetGauge([]string{"uptime"}, float32(hStats.Uptime))
2340+
metrics.SetGauge([]string{"client", "uptime"}, float32(hStats.Uptime))
23412341
}
23422342
}
23432343

0 commit comments

Comments
 (0)