[erlang-questions] exometer: per-client connection counts

Ulf Wiger ulf@REDACTED
Wed May 21 19:02:23 CEST 2014

One thing I have recently added to exometer is “auto-create templates”.
Basically, they are the same templates that exometer had before, but
now complemented with the function exometer:update_or_create(Name, Value).

The function will update the metric, if it exists, or otherwise look for a 
suitable template, create the metric, and then update it.

The idea is to be able to maintain metrics for different sessions without
necessarily knowing their identity. A name could e.g. look like:

[my_app, clients, 42, connect]

and a suitable metric type might be a ‘spiral', which maintains the value 
for the last minute as well as the total. 

Example template, example stored in a file, exometer_defaults.script:

%% -*- erlang-indent-level: 4; indent-tabs-mode: nil -*-
 {[my_app, clients, '_’, connect], spiral, []}

You could do the same thing with folsom, although the code for setup
and update would look slightly different. Also, with folsom, the spiral
window is  hard-coded to a minute, whereas in exometer, you can specify it.

Exometer is easier to extend with custom metrics and has a fairly
ambitious ‘function’ metric, which allows you to call just about any
function and either do limited pattern-matching, or even interpret code,
in order to convert the results into a metric value.

But it sounds like you have a working setup already. Perhaps better
to stick to that?

Ulf W

On 21 May 2014, at 15:44, Roger Lipscombe <roger@REDACTED> wrote:

> I'm wondering if exometer can help me with the following problem:
> Clients to our server are supposed to stay connected for a reasonable
> length of time. We're seeing some clients connecting and disconnecting
> repeatedly very quickly. It's difficult to see this in the log file,
> so I'm wondering whether exometer (or similar) could help.
> What I'm looking for is a way to push a 'client #42 connected' event,
> and have these grouped by client ID, and aggregated over, say, a 30
> second window. Then, if I saw more than say, 20 connection events from
> a particular client within the most-recent window, I could log that as
> a warning.
> Is this something that exometer (+graphite) can do? If so, does anyone
> have an example of how to do it?
> We're also playing with having a diagnostics UI -- something like the
> RabbitMQ admin UI -- it'd be nice to display the top 20 offenders.
> Is this something that exometer (or something else) could help with?
> Alternatively, we're already using folsom+folsomite+graphite. Could I
> do this using those?
> Thanks,
> Roger.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.

More information about the erlang-questions mailing list