lukevenediger / statsd.net

A high-performance stats collection service that feeds into Graphite and aimed at small- to large-scale windows environments.
MIT License
123 stars 25 forks source link

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

Open phillijw opened 9 years ago

phillijw commented 9 years ago

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.

lukevenediger commented 9 years ago

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

phillijw commented 9 years ago

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.

lukevenediger commented 9 years ago

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

phillijw commented 9 years ago

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
lukevenediger commented 9 years ago

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

phillijw commented 9 years ago

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: