expfmt: throw error when metric's name not provided instead panicing
This PR enhances extfmt behavior when incorrect metrics privided by user — metrics without name. Now TextParser throws error "invalid metrics name" instead of panicing (#3374)
@roidelapluie
@roidelapluie could you review PR, please?)
This change looks good to me. Can you add a test to exercise this case so we can catch regressions? And can you sign your commit to pass the DCO check? Thanks!
Hi, I would like to do a release of prom/common and this would be a nice fix to include, do you think you can add the test and fix DCO soon?
Hi, I would like to do a release of prom/common and this would be a nice fix to include, do you think you can add the test and fix DCO soon?
I've done everything. You can merge it)
P.S.
I also extended (*TextParser).reset() with p.currentMetric assignment to nil so that testcases wouldn't affect each other
@ywwg Could you merge PR, please?)
Hello! I would be glad if someone of you approved PR) @roidelapluie @gotjosh @ArthurSens
It is entirely possible though that this new test case covers a corner case in the parser we need to fix. I reached out for more eyes on this.