Skip to content

Commit

Permalink
Merge pull request #3882 from burdandrei/telemetry-add-node-class-tag
Browse files Browse the repository at this point in the history
Added node class to tagged metrics
  • Loading branch information
preetapan committed Jun 21, 2018
2 parents b30e234 + d9bb450 commit e2e6079
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2201,9 +2201,19 @@ DISCOLOOP:

// emitStats collects host resource usage stats periodically
func (c *Client) emitStats() {
// Determining NodeClass to be emitted
var emittedNodeClass string
if emittedNodeClass = c.Node().NodeClass; emittedNodeClass == "" {
emittedNodeClass = "none"
}

// Assign labels directly before emitting stats so the information expected
// is ready
c.baseLabels = []metrics.Label{{Name: "node_id", Value: c.NodeID()}, {Name: "datacenter", Value: c.Datacenter()}}
c.baseLabels = []metrics.Label{
{Name: "node_id", Value: c.NodeID()},
{Name: "datacenter", Value: c.Datacenter()},
{Name: "node_class", Value: emittedNodeClass},
}

// Start collecting host stats right away and then keep collecting every
// collection interval
Expand Down

0 comments on commit e2e6079

Please sign in to comment.