statsd.net icon indicating copy to clipboard operation
statsd.net copied to clipboard

Changing the statsdnet name doesn't actually modify the metric key

Open phillijw opened this issue 10 years ago • 6 comments

My understanding was that updating the <statsdnet name="statsd"> name attribute would modify the first piece of the metric to be "statsd" instead of "statsdnet". For some reason this doesn't appear to be the case in my testing.

phillijw avatar Jan 20 '15 19:01 phillijw

Hi Phillip, that will only change what's used when logging service-level metrics such as bad lines seen etc.

To modify the first piece of every metric you'll need to update the sections inside the node. For example:

    <aggregation flushInterval="5s">
        <gauges namespace="stats.gauges" removeZeroGauges="true" />
        <counters namespace="stats.counters" />
        <sets namespace="stats.sets" />
        <calendargrams namespace="stats.calgrams" />
        <timers namespace="stats.timers" calculateSumSquares="false">
            <percentile name="p90-5min" threshold="90" flushInterval="5m" />
            <percentile name="p90-1hour" threshold="90" flushInterval="1h" />
            <percentile name="p50-1hour" threshold="50" flushInterval="1h" />
        </timers>
    </aggregation>

In this example, every metric will be prefixed with "stats."

Thanks, Luke

lukevenediger avatar Jan 20 '15 19:01 lukevenediger

Ah, I see where I misunderstood. Thanks! Is there any way to turn off the service-level stats? With Librato and some other services we are paying per metric so unnecessary stats would be nice to disable.

phillijw avatar Jan 20 '15 19:01 phillijw

Yep definitely, just add a property called "hideSystemStats" to the root node and set it to true, like so:

<statsdnet name="statsdnet" hideSystemStats="true">
    <listeners>
    ...

Good luck and let me know how it goes!

Cheers, Luke

lukevenediger avatar Jan 20 '15 20:01 lukevenediger

Not sure why, but after setting that attribute to true and restarting the service, these 5 metrics keep showing up:

statsdnet.statsdnet.backends.librato.lines
statsdnet.statsdnet.backends.librato.post.attempt
statsdnet.statsdnet.backends.librato.post.success
statsdnet.statsdnet.outputBuffer
statsdnet.statsdnet.up

phillijw avatar Jan 20 '15 21:01 phillijw

hmm that's interesting. I'll have to investigate that.

lukevenediger avatar Jan 21 '15 11:01 lukevenediger

Hey Luke, I appreciate your responses. As I was thinking about this, I realized that I'm actually running two instances of statsd.net and didn't change one of the configs. I'm going to try fixing that and I'm assuming this issue will resolve itself :+1:

phillijw avatar Jan 21 '15 21:01 phillijw