grobian / carbon-c-relay

Enhanced C implementation of Carbon relay, aggregator and rewriter
Apache License 2.0
380 stars 107 forks source link

The metric length limit greater than 255 has stopped working #412

Closed ihard closed 4 years ago

ihard commented 4 years ago

In version 3.2 I used a simple restriction on the length of the passed metric: ^.{500,}$

However in versions 3.5 and 3.6 I see this error:

[2020-04-29 17:37:48] /etc/carbon-c-relay.conf:32:4: invalid expression '^.{500,}$': Invalid contents of {}
[2020-04-29 17:37:48]     ^.{500,}$
[2020-04-29 17:37:48]     ^^^^^^^^^
[2020-04-29 17:37:48] failed to read configuration '/etc/carbon-c-relay.conf'

Experimentally I realized that the maximum number is 255 at which this expression is valid. Is there any way to check the length of the metric more than 255 characters?

grobian commented 4 years ago

this really is stuff that the regex implementation takes care of, which one are you using?

carbon-c-relay -v should print it for you.

ihard commented 4 years ago
carbon-c-relay v3.6 (49b564-dirty)
regular expressions library: libc

I thought a little and got around this error like this: ^.{250,}.{251,}$