pcp icon indicating copy to clipboard operation
pcp copied to clipboard

statsd: dont throw away datagrams which include # but have no labels

Open Erbenos opened this issue 3 years ago • 1 comments

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

Erbenos avatar Dec 12 '21 12:12 Erbenos

Upon further inspection seems to be an inconsistency between separate parsers, Ragel based parser consumes metric:5|c|#.

Erbenos avatar Dec 12 '21 12:12 Erbenos

@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.

Erbenos avatar Dec 15 '22 21:12 Erbenos

Accepting trailing empty '#' looks to be more robust, if that is not something too difficult to do.

lzap avatar Dec 19 '22 11:12 lzap

@Erbenos I think you've fixed this already, is that correct?

natoscott avatar Jul 17 '23 06:07 natoscott

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

Erbenos avatar Jul 17 '23 09:07 Erbenos

We don’t depend on this feature so it is also okay to close this for now. Thanks.

lzap avatar Jul 17 '23 13:07 lzap

@Erbenos @lzap thanks! I'll leave the decision with you then @Erbenos as to which path to take (relax parser or close).

natoscott avatar Jul 18 '23 06:07 natoscott

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.

Erbenos avatar Jul 18 '23 06:07 Erbenos