Skip to content

Instantly share code, notes, and snippets.

@eladroz
Last active October 6, 2016 18:14
Show Gist options
  • Save eladroz/5081492 to your computer and use it in GitHub Desktop.
Save eladroz/5081492 to your computer and use it in GitHub Desktop.
Graphite aggregation rules for StatsD (excl. for threshold metrics)
#
# These settings are REALLY sensitive! do you feel lucky??
# Consult the documentation for etsy/statsd, but it doesn't have all the info.
#
# Notes:
#
# (a) When determining xFilesFactor, make sure the actual reporting rate would fill enough buckets,
# so that the downsampling won't result in null values.
#
# (b) Up to StatsD v0.5.0, counters are written in two places:
# (1) non-normalized counters (containing the count per flushInterval) under 'stats_counts'
# (2) per-second normalized counts directly under 'stats', without anything identifying them as counts.
# Post-0.5.0 this inconsistency should be considered 'legacy',
# and both types should be under stats.counters (graphite.legacyNamespace should be set to false)
# => In any case, you must ensure that normalized counters are AVERAGED, while non-normalized ones are SUMMED.
#
# For min/max values computed by StatsD for timers, don't store the average (which is default) but the min/max point
[statsd_timers_lower]
pattern = \.lower$
xFilesFactor = 0.1
aggregationMethod = min
[statsd_timers_upper]
pattern = \.upper$
xFilesFactor = 0.1
aggregationMethod = max
# Sum the sum values...
[statsd_timers_sum]
pattern = \.sum$
xFilesFactor = 0.1
aggregationMethod = sum
# Sum non-normalized counts for timers & new-style counters
[statsd_non_normalized_count]
pattern = \.count$
xFilesFactor = 0.1
aggregationMethod = sum
# Sum non-normalized counts for old-style counters
[statsd_non_normalized_count_legacy]
pattern = ^stats_counts\..*
xFilesFactor = 0.1
aggregationMethod = sum
# Everything else
[default_average]
pattern = .*
xFilesFactor = 0.2
aggregationMethod = average
@nathanpbell
Copy link

[Probably better to leave this comment on the gist] I'm curious, where do you see .min$ .max$ metrics in timers? Mine are .upper, .upper_90, .lower, .lower_90. Perhaps the newer versions of StatsD have changed these metric names?

@eladroz
Copy link
Author

eladroz commented Mar 6, 2013

Fixed for upper/lower, thx!

@tehlers320
Copy link

pattern = .upper$ does not catch upper_90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment