Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix newrelic.coffee #1347

Merged
merged 1 commit into from

2 participants

Riccardo Cambiassi Josh Nichols
Riccardo Cambiassi
bru commented

The Newrelic script didn't work (at least on our new hubot). Afaict this was happening because of variables being referenced out of scope.

This fixed it for us.

Riccardo Cambiassi bru fix newrelic.coffee
The Newrelic script didn't work (at least on our new hubot). Afaict this was happening because of variables being referenced out of scope.

This fixed it for us.
b15ad07
Josh Nichols technicalpickles merged commit 2966302 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 4, 2014
  1. Riccardo Cambiassi

    fix newrelic.coffee

    bru authored
    The Newrelic script didn't work (at least on our new hubot). Afaict this was happening because of variables being referenced out of scope.
    
    This fixed it for us.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/scripts/newrelic.coffee
7 src/scripts/newrelic.coffee
View
@@ -22,8 +22,10 @@
# Author:
# briandoll
+Parser = require("xml2js").Parser
+
module.exports = (robot) ->
- fetchData = (appId) ->
+ fetchData = (accountId, appId, apiKey, msg) ->
msg.http("https://rpm.newrelic.com/accounts/#{accountId}/applications/#{appId}/threshold_values?api_key=#{apiKey}")
.get() (err, res, body) ->
if err
@@ -41,6 +43,5 @@ module.exports = (robot) ->
accountId = process.env.HUBOT_NEWRELIC_ACCOUNT_ID
appIds = process.env.HUBOT_NEWRELIC_APP_ID.split(',')
apiKey = process.env.HUBOT_NEWRELIC_API_KEY
- Parser = require("xml2js").Parser
- fetchData(appId) for appId in appIds
+ fetchData(accountId, appId, apiKey, msg) for appId in appIds
Something went wrong with that request. Please try again.