Using Graphite for stats - from Serverless Infrastructure

9/26/2016

I am starting with a new application, that is intended to be run in a more "cloud" way following the idea of serverless infrastructure, where there is no notion of a "machine" anymore, but just an application running somewhere.

As Graphite only knows "absolute" values, typically, the host name of the server would be encoded in the metric path to deal with concurrency. (e.g. applicationname.webserver_1.requestCount). Using Graphite functions, data can be merged easily when building graphs.

However when I run in a server less environment, hostnames do not exist in the classical sense anymore - every time the application is restarted or deployed a new, random hostname will be generated for it. What I am wondering now, is - how to best deal with this. I can't use the hostname, because this way I will end up with hundreds of different hostnames quite quickly and a completely unusable graphite backend. What are the best practices in this use case?

As a sidenote - this is not only to measure counters, but also to measure response times (where p99 functions will be applied).

I'd like to use dropwizard-metrics (formally known as codahale metrics) to send messages to grahite, however that should be only an implementation detail.

Thanks a lot for you help.

-- Matthias Huttar
codahale-metrics
graphite
java
kubernetes

1 Answer

9/27/2016

The plan for now is to not directly sent to Graphite, but to go via StatsD, which is able to do the necessary aggregation. In this case there's no need to embed the hostname.

thanks for your suggestions! :)

-- Matthias Huttar
Source: StackOverflow