Skip to content

Commit

Permalink
Added node names to Prometheus metrics link_tq.
Browse files Browse the repository at this point in the history
  • Loading branch information
eberhab committed Mar 22, 2016
1 parent 9abace5 commit af0a635
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hopglass-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,10 @@ function getMetrics(stream) {
if (source === undefined) {
source = src.replace(/:/g, '')
}
stream.write('link_tq{source="' + source + '",target="' + target + '"} ' + tq + '\n')
var source_name = _.get(data, [source, 'nodeinfo', 'hostname'], source)
var target_name = _.get(data, [target, 'nodeinfo', 'hostname'], target)
stream.write('link_tq{source="' + source + '",target="' + target
+ '",source_name="' + source_name + '",target_name="' + target_name + '"} ' + tq + '\n')
}
}
}
Expand Down

0 comments on commit af0a635

Please sign in to comment.