I 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...
Hi @marceloboeira thanks for creating the issue! hmm yes lets see, I can have a look later (https://github.com/sitespeedio/sitespeed.io#vacation-july---august) but if you could do some background research what's right or make a PR I can merge/release it. Ping @omrilotan do you know, you use that functionality right?
Best
Peter
@soulgalore the issue is somewhere around here: https://github.com/sitespeedio/sitespeed.io/blob/8193a31245b5bf963aecd692c486ac4fa79e3c35/lib/plugins/graphite/index.js#L79
I am trying to debug to figure
I think I know what the issue is. I'll run a couple of tests and suggest a solution today
@omrilotan thanks a lot!
@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)
@omrilotan thanks for the fix, I've approved the PR. I will build the PR and try to run here.
Please let me know. Thank you for testing it
@omrilotan I've tested here, looks like its working properly now:
root@marcelo-sitespeed-new-7b4759756b-62bkf:/sitespeed.io# nc -ulp 8125
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.score:68|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.performance.score:65|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.bestpractice.score:81|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.accessibility.score:62|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.info.documentHeight:6195|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.info.domElements:773|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.info.domDepth.avg:10|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.info.domDepth.max:16|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.info.iframes:1|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.info.scripts:35|ms
sitespeed_io.default.pageSummary.hey_car._.chrome.3gfast.coach.advice.info.localStorageSize:100|ms
Thanks a lot for fixing it.
I pushed 7.2.3 just now. Thanks @omrilotan for fixing this so fast!!!
Most helpful comment
I pushed 7.2.3 just now. Thanks @omrilotan for fixing this so fast!!!