common icon indicating copy to clipboard operation
common copied to clipboard

expfmt: throw error when metric's name not provided instead panicing

Open Alhanaqtah opened this issue 5 months ago • 6 comments

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

Alhanaqtah avatar Aug 05 '25 20:08 Alhanaqtah

@roidelapluie could you review PR, please?)

Alhanaqtah avatar Aug 08 '25 18:08 Alhanaqtah

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!

ywwg avatar Aug 11 '25 13:08 ywwg

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?

ywwg avatar Aug 14 '25 16:08 ywwg

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

Alhanaqtah avatar Aug 15 '25 08:08 Alhanaqtah

@ywwg Could you merge PR, please?)

Alhanaqtah avatar Aug 28 '25 19:08 Alhanaqtah

Hello! I would be glad if someone of you approved PR) @roidelapluie @gotjosh @ArthurSens

Alhanaqtah avatar Sep 26 '25 13:09 Alhanaqtah

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.

jan--f avatar Dec 22 '25 12:12 jan--f