etsy / logster

Parse log files, generate metrics for Graphite and Ganglia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MetricParser requires characters before and after metric command

beberlei opened this issue · comments

If i just want to publish metrics then i have to log:

$logger->info(" METRIC_COUNT metric=foo value=1 ");

Why is this necessary? couldn't the regexp allow no spaces as well? This is a source of bugs in our code where metrics don't get published because people forget to add spaces around them.

The MetricLogster METRIC_COUNT regular expression requires there to be at least a single character matching [^0-9.] after the metric value. It will however allow you to have no leading spaces (or other characters) before the METRIC_COUNT entry.

You can see the regular expression it's using here https://github.com/etsy/logster/blob/de0626/logster/parsers/MetricLogster.py#L67

I think it would be safe to drop the [^0-9.] requirement after the metric value. How would you feel about creating a pull request with that change?

Any update on this?

I'm closing this as I think the question has been answered.

@beberlei feel free to reopen if you need to talk further on it