Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Alhanaqtah
Copy link

@Alhanaqtah Alhanaqtah commented Aug 5, 2025

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
Copy link
Author

@roidelapluie could you review PR, please?)

@ywwg
Copy link
Member

ywwg commented Aug 11, 2025

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
Copy link
Member

ywwg commented Aug 14, 2025

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?

Signed-off-by: Banana Duck <a.usama@yandex.ru>
@Alhanaqtah Alhanaqtah force-pushed the initiate-error-when-metric-without-name branch from cfaa159 to ec048aa Compare August 15, 2025 08:57
@Alhanaqtah
Copy link
Author

Alhanaqtah commented Aug 15, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants