Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Graphite is great, but unfortunately the web UI itself isn't instrumented. (Yo dawg, I heard you like graphite.) Enable the directives to log render and cache performance, then monitor this with collect's tail plugin so you can visualize graphite performance.
LoadPlugin tail
<Plugin tail>
# cache performance
<File "/opt/graphite/storage/log/webapp/cache.log">
Instance "graphite_web"
<Match>
Regex "Request-Cache hit "
DSType "CounterInc"
Type "counter"
Instance "request_cache_hit"
</Match>
<Match>
Regex "Request-Cache miss "
DSType "CounterInc"
Type "counter"
Instance "request_cache_miss"
</Match>
<Match>
Regex "CarbonLink creating a new socket "
DSType "CounterInc"
Type "counter"
Instance "socket_create_count"
</Match>
<Match>
Regex "CarbonLink cache-query request "
DSType "CounterInc"
Type "counter"
Instance "query_count"
</Match>
<Match>
Regex "CarbonLink set-metadata request "
DSType "CounterInc"
Type "counter"
Instance "set-metadata_count"
</Match>
<Match>
Regex "Data-Cache hit "
DSType "CounterInc"
Type "counter"
Instance "data_cache_hit"
</Match>
<Match>
Regex "Data-Cache miss "
DSType "CounterInc"
Type "counter"
Instance "data_cache_miss"
</Match>
</File>
# rendering performance
<File "/opt/graphite/storage/log/webapp/rendering.log">
Instance "graphite_web"
# PNG's
<Match>
Regex "Rendered PNG in ([0-9\.]+) seconds"
DSType "CounterInc"
Type "requests"
Instance "render_png_count"
</Match>
<Match>
Regex "Rendered PNG in ([0-9\.]+) seconds"
DSType "GaugeMin"
Type "response_time"
Instance "render_png_time_min"
</Match>
<Match>
Regex "Rendered PNG in ([0-9\.]+) seconds"
DSType "GaugeMax"
Type "response_time"
Instance "render_png_time_max"
</Match>
<Match>
Regex "Rendered PNG in ([0-9\.]+) seconds"
DSType "GaugeAverage"
Type "response_time"
Instance "render_png_time_avg"
</Match>
# pickle (carbonlink)
<Match>
Regex "Total pickle rendering time ([0-9\.]+)"
DSType "CounterInc"
Type "counter"
Instance "render_pickle_count"
</Match>
<Match>
Regex "Total pickle rendering time ([0-9\.]+)"
DSType "GaugeMin"
Type "response_time"
Instance "render_pickle_time_min"
</Match>
<Match>
Regex "Total pickle rendering time ([0-9\.]+)"
DSType "GaugeMax"
Type "response_time"
Instance "render_pickle_time_max"
</Match>
<Match>
Regex "Total pickle rendering time ([0-9\.]+)"
DSType "GaugeAverage"
Type "response_time"
Instance "render_pickle_time_avg"
</Match>
# rawData (json, csv, etc)
<Match>
Regex "Total rawData rendering time ([0-9\.]+)"
DSType "CounterInc"
Type "counter"
Instance "render_rawdata_count"
</Match>
<Match>
Regex "Total rawData rendering time ([0-9\.]+)"
DSType "GaugeMin"
Type "response_time"
Instance "render_rawdata_time_min"
</Match>
<Match>
Regex "Total rawData rendering time ([0-9\.]+)"
DSType "GaugeMax"
Type "response_time"
Instance "render_rawdata_time_max"
</Match>
<Match>
Regex "Total rawData rendering time ([0-9\.]+)"
DSType "GaugeAverage"
Type "response_time"
Instance "render_rawdata_time_avg"
</Match>
# total render time
<Match>
Regex "Total rendering time ([0-9\.]+) seconds"
DSType "CounterInc"
Type "counter"
Instance "total_render_count"
</Match>
<Match>
Regex "Total rendering time ([0-9\.]+) seconds"
DSType "GaugeMin"
Type "response_time"
Instance "total_render_time_min"
</Match>
<Match>
Regex "Total rendering time ([0-9\.]+) seconds"
DSType "GaugeMax"
Type "response_time"
Instance "total_render_time_max"
</Match>
<Match>
Regex "Total rendering time ([0-9\.]+) seconds"
DSType "GaugeAverage"
Type "response_time"
Instance "total_render_time_avg"
</Match>
# cached response time
<Match>
Regex "Returned cached response in ([0-9\.]+) seconds"
DSType "CounterInc"
Type "counter"
Instance "cached_response_time_count"
</Match>
<Match>
Regex "Returned cached response in ([0-9\.]+) seconds"
DSType "GaugeMin"
Type "response_time"
Instance "cached_response_time_min"
</Match>
<Match>
Regex "Returned cached response in ([0-9\.]+) seconds"
DSType "GaugeMax"
Type "response_time"
Instance "cached_response_time_max"
</Match>
<Match>
Regex "Returned cached response in ([0-9\.]+) seconds"
DSType "GaugeAverage"
Type "response_time"
Instance "cached_response_time_avg"
</Match>
# data retrieval time
<Match>
Regex "Retrieval of [^ ]+ took ([0-9\.]+)"
DSType "CounterInc"
Type "counter"
Instance "retrieval_count"
</Match>
<Match>
Regex "Retrieval of [^ ]+ took ([0-9\.]+)"
DSType "GaugeMin"
Type "response_time"
Instance "retrieval_time_min"
</Match>
<Match>
Regex "Retrieval of [^ ]+ took ([0-9\.]+)"
DSType "GaugeMax"
Type "response_time"
Instance "retrieval_time_max"
</Match>
<Match>
Regex "Retrieval of [^ ]+ took ([0-9\.]+)"
DSType "GaugeAverage"
Type "response_time"
Instance "retrieval_time_avg"
</Match>
</File>
</Plugin>
@obfuscurity

This comment has been minimized.

Copy link

@obfuscurity obfuscurity commented Nov 20, 2015

Note that rawData (L109) really is only format=raw, it has nothing to do with the other formats mentioned in the comment.

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