-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation of the metric lenght #354
Comments
I wonder if it is possible to do so. What you do (I think) is search for consecutive bits between dots (is directory or file) which is what the code would have to do too. Unless you'd be happy with a generic length cap which doesn't look at anything but character count of course. |
You are right, it looks for bits between dots. Depending on what kind of the storage back-end is used the set of limits can be different, so I am not sure that generic metric length will be sufficient. |
The only way is to add custom logic at the core that doesn't involve regex machinery, but it means you'd always have to pay for this cost. I think an example is a good start in any case, we can alway revisit this once it seems it is too expensive to perform like this. |
It turned out that this regex is very costly, It dropped the relay capacity on |
which regex impl are you using? |
perf top saying: |
I switched to a configurable impl, but most importantly oniguruma is by orders of magnitude better than the libc impl. |
What appears to be possible here, is to take the length of the entire input into account. That is, not just the metric name. Capping that value probably is enough for you. |
What do you think about introducing a metric length validation as a configurable parameter?
The question comes from this issue: go-graphite/go-carbon#258
In order to ease our lives we would like to filter metrics on relays and currently can do this by the next rule:
Might be this can be done in the code internally in more efficient manner?
The text was updated successfully, but these errors were encountered: