Skip to content

Commit

Permalink
Added node class to tagged metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
burdandrei committed Feb 18, 2018
1 parent 4abacc5 commit efd0e1d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,15 @@ DISCOLOOP:
func (c *Client) emitStats() {
// 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()}}
var emittedNodeClass string
if emittedNodeClass = c.config.Node.NodeClass; emittedNodeClass == "" {
emittedNodeClass = "none"
}
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 efd0e1d

Please sign in to comment.