robn/Prometheus-Tiny

Uninitialized values warnings in the log

blackpaulillyria opened this issue · 3 comments

Hi, seeing lots of warnings for this issue in the log

Warning: Use of uninitialized value $lv in substitution (s///) at /usr/local/lib/perl5/site_perl/Prometheus/Tiny.pm line 28.
Warning: Use of uninitialized value $lv in substitution (s///) at /usr/local/lib/perl5/site_perl/Prometheus/Tiny.pm line 29.
Warning: Use of uninitialized value $lv in concatenation (.) or string at /usr/local/lib/perl5/site_perl/Prometheus/Tiny.pm line 30.
robn commented

This happens when you try to give a label a value of undef. So the answer is, at least, "don't do that", but maybe I can put in a little protection for it.

Do you have a specific test case so I can be sure I'm addressing your particular situation?

I'm getting that as part of authentication_milter. Think this is where it's being used https://github.com/fastmail/authentication_milter/blob/master/lib/Mail/Milter/Authentication/Metric.pm

robn commented

Ahh, then that'll be that piece of software doing the wrong thing. You'll need to open an issue over there; I can't fix it in the library.