diff --git a/lib/librato.js b/lib/librato.js index 98a5861..7ef9321 100644 --- a/lib/librato.js +++ b/lib/librato.js @@ -279,6 +279,8 @@ var flushStats = function libratoFlush(ts, metrics) { gauges.push(legacyMeasure); } } + + delete measure.source; // Add the payload measurements.push(measure); // Post measurements and clear arrays if past batch size diff --git a/test/librato_tests.js b/test/librato_tests.js index b31f9dc..1bde1eb 100644 --- a/test/librato_tests.js +++ b/test/librato_tests.js @@ -386,12 +386,14 @@ module.exports.legacy = { config.librato.sourceRegex = /^(.*?)--/; librato.init(null, config, this.emitter); - test.expect(8); + test.expect(9); let metrics = {gauges: {'rails-application--my_gauge': 1}}; this.apiServer.post('/v1/measurements') .reply(200, (uri, requestBody) => { let measurement = requestBody.measurements[0]; test.ok(requestBody); + // no source when using the measurements api + test.equal(measurement.source, undefined); test.equal(measurement.name, 'my_gauge'); test.equal(measurement.value, 1); test.deepEqual(measurement.tags, {source: 'rails-application'});