-
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
Filter invalid lines. #87
Conversation
Checks the number of fields in a line, there should be three fields. Fields are separated by spaces, count the spaces and forward only lines which have two spaces in them.
so,the problem is you want the relay to discard lines that do not follow the |
Yes, that is correct. I'm currently at a large organisation with an "open" Graphite for other teams to use. A lot of them send badly formatted metrics, I would like to filter them out on the relay instead of sending them to the downstream carbon-cache's. |
Hmm, I see the usecase here. We have the same setup ("open" Graphite) but rely on the stores dealing with random crap people seem to produce. I guess performance-wise this doesn't make much difference, visibility wise, I think it needs a new counter metricsInvalid or something to check we're not dropping like mad unexpectedly. I need to think this through a bit. |
I eventuall want to log the invalid lines someway, not sure yet how as I want to avoid disk run full when someone messes up and starts sending millions invalid lines every second (things like that happen..). The reason why I would prefer this in the relay instead of the stores is that the relay has the source IP of the offender (and could log that), where the stores only see source ip of the relay. |
Heh, now you actually request the same as issue #78, and the source IP is currently hard to get at the level where we'd log. |
I'm more interested in logging wrongly formatted lines, the other request is for correct lines based on non-wanted metricname Take for example the following lines:
with #78 you can configure that 1 and 2 will be sent to dest1 and 3 to be logged. My intention is to only drop/log line 2. |
Something like this https://github.com/Skyscanner/carbon-relay-ng/commit/69eafe322140b59d728cdc0be2e04b36f7552fa3 makes me feel like it should be an option whether or not to do validation. |
Sorry for the long delay. I've started a new project at a new customer and my focus got a bit changed by that. I don't expect to have time to finish it soon. :(
Anyway, I don't mind if you close this one and leave unimplemented. |
Sorry for late response. Thank you for reviewing and commenting my code. The suggested regex would be great! Unfortunately I still don't expect to have time to rework this soon ... :( |
don't worry, this is on my todo stack for implementing, I hope to be able to reuse your intial patch. |
Is this Value filtering been implemented in latest release. |
nope |
I've introduced a |
Checks the number of fields in a line, there should be three fields. Fields are
separated by spaces, count the spaces and forward only lines which have two
spaces in them.
It's been a while since I wrote C... please check carefully.