Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
5c077yP committed Jan 21, 2016
1 parent bfd0978 commit 178c9cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions lib/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ _.extend(Backend.prototype, {
collect_counters(date, filter_metrics(metrics.counters, this), this.dimensions),
collect_gauges(date, filter_metrics(metrics.gauges, this), this.dimensions))

if (debug)
l.log('cloudwatch - flushing ' + data.length + ' metrics')

while (data.length > 0) {
var params = {
Namespace: this.namespace,
Expand Down
8 changes: 4 additions & 4 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ exports.init = function(startupTime, config, emitter, logger) {
}

// load some meta data information
var metadataServce = new AWS.MetadataService()
var metadataServce = new AWS.MetadataService({ httpOptions: { timeout: 10000 } })
var metadata = {};
logger.log('cloudwatch - requesting the metadata api')
metadataServce.request('/latest/meta-data/instance-id', function(err, data) {
if (err) {
if (config.debug)
logger.log('cloudwatch backend could not access meta-data service: ' + err.code)

if (config.dumpMessages)
fmt.dump(err)

return
} else {
metadata.InstanceId = data
}
metadata.InstanceId = data

// update dimensions with meta data information
Object.keys(config.dimensions).forEach(function (key) {
Expand Down

0 comments on commit 178c9cf

Please sign in to comment.