graphite-project / carbon

Carbon is one of the components of Graphite, and is responsible for receiving metrics over the network and writing them down to disk using a storage backend.
http://graphite.readthedocs.org/
Apache License 2.0
1.5k stars 490 forks source link

Fix #871: Adjust aggregator-rules input_pattern match greediness #872

Closed hessu closed 4 years ago

hessu commented 4 years ago

... to support numeric matching after captured field. Fixes bug #871 .

Before, an input regexp of "collectd.mycluster-\<location>\d+.app.requests" in aggregation-rules.conf, with a hostname of "mycluster-paris105" would capture "paris10" as the location, instead of paris. With a large cluster this would create a whole lot of aggregates, one per 10 nodes.

This patch makes the \<location> match not greedy, letting the user-supplied \d+ side to be greedy and eat the 105 away fully, leaving "paris" as the location.

piotr1212 commented 4 years ago

@deniszh It seems that pyhash does not support py27 anymore which results in failing travis builds. We should drop py27-pyhash or pin pyhash to some older version.

deniszh commented 4 years ago

@piotr1212 : I'm voting for drop, but pinning also OK for me.

@hessu : thanks for fix, LGTM!