statsd weird formatting
See original GitHub issueI want to push sitespeed.io to datadog, which uses mostly the standard statsd protocol.
I’ve tried to use the config as:
{
"browsertime": {
"connectivity": {
"profile": "3gfast"
},
"video": false,
"visualMetrics": true,
"iterations": 5,
"chrome": {
"timeline": true
}
},
"chrome": {
"timeline": true
},
"crawler": {
"depth": 1
},
"plugins": {
"remove": ["screenshot"]
},
"graphite": {
"statsd": true,
"bulkSize": 20,
"host": "datadog-statsd.kube-system",
"port": "8125"
},
"utc": true,
"mobile": true,
"video": false,
"firstParty": ".hey.car"
}
And it didn’t work. So, I’ve tried to push to my localhost and monitor the statsd port with netcat:
root@marcelo-sitespeed-55fbb56dd-x8dxg:/sitespeed.io# nc -ulp 8125
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.XHRReadyStateChange.p90:1|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.XHRReadyStateChange.p99:1|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.XHRReadyStateChange.max:1|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.MajorGC.median:6|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.MajorGC.mean:6|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.MajorGC.mdev:0|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.MajorGC.min:6|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.MajorGC.p10:6|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.MajorGC.p90:6|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.MajorGC.p99:6|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.MajorGC.max:6|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.median:0|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.mean:0|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.mdev:0|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.min:0|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.p10:0|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.p90:0|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.p99:0|ms 1532331394
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.max:0|ms 1532331394
However, it looks like the formatting is wrong, I am not sure about that timestamp at the end. The 1532331394
.
If I manually push sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.max:0|ms 1532331394
to datadog, it doesn’t work, as expected. But, if I remove the timestamp and I push sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.browsertime.statistics.cpu.events.ScriptWrappableMarkingVisitor__performLazyCleanup.max:0|ms
it works.
update
I manually pushed metrics with the same library, using this snippet:
const dgram = require('dgram');
const client = dgram.createSocket('udp4');
const data = "sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast2.browsertime.statistics.cpu.events.MajorGC.max:10|ms";
client.send(data, 0, data.length, "8125", "datadog-statsd.kube-system");
And it worked, so I believe there is something wrong in the code…
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (2 by maintainers)
I pushed 7.2.3 just now. Thanks @omrilotan for fixing this so fast!!!
@marceloboeira Do you have an option to test the PR I’ve posted fixes your issue? If it does, I will also copy this fix into the stable version. (6.x)