pcp
pcp copied to clipboard
statsd: dont throw away datagrams which include # but have no labels
As specified in readme, agent accepts messages which specify labels using hashtag like so metric:5|c|#tagX:X,tagW:W
but it throws away messages which do include # but without any tags specified eg. metric:5|c|#
. As this is what gets send by some libraries it is desirable to allow this form too, instead of being needlessly strict and throw it away like is done now.
Erbenos/pmdastatsd#13
Upon further inspection seems to be an inconsistency between separate parsers, Ragel based parser consumes metric:5|c|#
.
@lzap Would you prefer that both parsers accept the trailing #
or none of them did? I believe you mentioned it was an issue with the given library you had, so I am not sure here which way to go.
Accepting trailing empty '#' looks to be more robust, if that is not something too difficult to do.
@Erbenos I think you've fixed this already, is that correct?
No, I just refactored the code of the Ragel parser so that its more sane. It accepts that string (see https://user-images.githubusercontent.com/6019671/208208241-4ce6744b-50b4-4dbe-b6ae-8790b3e7004b.svg). I ll have to relax the other parser
We don’t depend on this feature so it is also okay to close this for now. Thanks.
@Erbenos @lzap thanks! I'll leave the decision with you then @Erbenos as to which path to take (relax parser or close).
Just close it now - it was suboptimal decision to have 2 parsers in first place, I ll probably end up removing the non-Ragel one as its harder to maintain, if I ever get back to it. Sorry for keeping the spam in issues, given the nature of this I just put it on backburner and didn't really think of it.