Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit da83fea

Browse files
For newrelic, send one message with all the thresholds, and another with the link
1 parent 228c6a7 commit da83fea

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/scripts/newrelic.coffee

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ module.exports = (robot) ->
3434
if err
3535
msg.send "New Relic says: #{err}"
3636
return
37+
3738
(new Parser).parseString body, (err, json)->
38-
for threshold_value in json['threshold_value']
39-
msg.send " #{threshold_value['@']['name']} : #{threshold_value['@']['formatted_metric_value']}"
40-
msg.send " https://rpm.newrelic.com/accounts/#{accountId}/applications/#{appId}"
39+
threshold_values = json['threshold_value'] || []
40+
lines = threshold_values.map (threshold_value) ->
41+
"#{threshold_value['@']['name']}: #{threshold_value['@']['formatted_metric_value']}"
42+
43+
msg.send lines.join("\n"), "https://rpm.newrelic.com/accounts/#{accountId}/applications/#{appId}"

0 commit comments

Comments
 (0)