question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

statsd weird formatting

See original GitHub issue

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…

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
soulgalorecommented, Jul 23, 2018

I pushed 7.2.3 just now. Thanks @omrilotan for fixing this so fast!!!

2reactions
omrilotancommented, Jul 23, 2018

@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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Practical guide to StatsD/Graphite monitoring | Hacker News
In addition to this helpful guide, note that statsd / graphite both ... Oh, yeah, it's weird but not even a serious limitation:...
Read more >
Brubeck, a statsd-compatible metrics aggregator
statsd is a Metrics (with capital M) aggregation daemon written in Node. js. Its job is taking complex Metrics and aggregating them in...
Read more >
node.js - Tracking metrics using StatsD (via etsy) and Graphite ...
The way the whisper file format is designed, it expect you (or your ... This produces really weird results on your graph because...
Read more >
Charity Majors on Twitter: "in honor of #monitorama and all the ...
"metrics" can either mean a generic synonym for telemetry data, or "statsd-style integers with tags appended for grouping". the first is ...
Read more >
Was This FNCS the Best or Worst Format? - YouTube
Today we recap everything that happened on the final day of the FNCS Grand Royale tournament! We had Bugha, Mero and Dukes take...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found