Skip to content
This repository has been archived by the owner on Feb 1, 2018. It is now read-only.

Commit

Permalink
update version, set content length properly (was testing on the wrong…
Browse files Browse the repository at this point in the history
… version)
  • Loading branch information
ekilby committed Sep 6, 2013
1 parent af18773 commit 2940200
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/stackdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,17 @@ StackdriverBackend.prototype.post_message_to_gateway = function(stackdriverMessa
return;
}

messageString = JSON.stringify(stackdriverMessage)

// setup the HTTPS request
var options = {
host : this.stackdriverHost,
path : this.stackdriverPath,
method : 'POST',
headers : {
"Content-Length" : messageString.length,
"Content-Type" : "application/json; charset=utf-8",
"x-stackdriver-apikey" : this.apiKey,
"Content-Length" : stackdriverMessage.length,
"User-Agent": "stackdriver-statsd-backend-0.1.2"
}
};
Expand All @@ -109,7 +111,7 @@ StackdriverBackend.prototype.post_message_to_gateway = function(stackdriverMessa

if (this.debug) {
util.log("Message contents to be posted:");
util.log(JSON.stringify(stackdriverMessage));
util.log(messageString);
}

// perform the HTTPS request
Expand All @@ -128,7 +130,7 @@ StackdriverBackend.prototype.post_message_to_gateway = function(stackdriverMessa
util.log("STACKDRIVER GATEWAY RESPONSE: " + chunk);
});
});
req.write(JSON.stringify(stackdriverMessage));
req.write(messageString);
req.end();

req.on('error', function(e) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stackdriver-statsd-backend",
"version": "0.1.2",
"version": "0.1.3",
"description": "Send metric data from statsd to Stackdriver",
"main": "lib/stackdriver.js",
"scripts": {
Expand Down

0 comments on commit 2940200

Please sign in to comment.