prometheus / prometheus/common
Potential bug in text parser
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 295
- Forks
- 367
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 18
Description
We use the text parser within our application to scrape prometheus metrics and are facing an issue related to one described here: https://github.com/uber/cadence/issues/3120
cadence exposes two histogram metrics named signal_info and signal_info_count.
When parsing the HELP line for the signal_info_count the parser appears to strip the _count suffix and sets the p.currentMF property: https://github.com/prometheus/common/blob/f39dfa2b000545b3a763b844012958c275a62266/expfmt/text_parse.go#L688
This ends up setting the property to the earlier signal_info histogram leading to the parser error here:
https://github.com/prometheus/common/blob/f39dfa2b000545b3a763b844012958c275a62266/expfmt/text_parse.go#L485
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in expfmt/text_parse.go around the HELP-line handling near the referenced lines, and reproduce parsing for the signal_info and signal_info_count histograms. Trace how the _count suffix affects p.currentMF and the later parser error. Done means both metric names are retained distinctly and the input parses without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100