boundary / folsom

Expose Erlang Events and Metrics
Apache License 2.0
585 stars 166 forks source link

support tags in configuration file #90

Open linbo opened 9 years ago

linbo commented 9 years ago

Hi,

Since for most cases, metrics are already predefined in different groups, init metrics with tags is preferred.

I think can folsom support tags in configuration file? for example

 $ echo '[{folsom, [{history, [{hist1, [tag1, tag2]}, {hist2, [tag2, tag3]} ]}, {gauge, gauge1}]}].' \
      > myapp.config
   $ erl -pa ebin deps/*/ebin -config myapp.config -s folsom

The init code changed as flowing:

configure_metric(New, Spec) when is_list(Spec) ->
    apply(folsom_metrics, New, Spec);
configure_metric(New, Spec) ->
    case Spec of
        {Name, Tags} ->
            folsom_metrics:New(Name),
            [folsom_metrics:tag_metric(Name, Tag) || Tag <- Tags];
        Name ->
            folsom_metrics:New(Name)
    end.

If accept, can I send a pull request?

joewilliams commented 8 years ago

Folsom has moved, please resubmit your issue at https://github.com/folsom-project Thanks!