Ensure all versions of Content Type are correctly handled in the code.
- Dominant language
- Go
- Stars
- 12.7k
- Forks
- 5k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 370
Description
The Prometheus metricset currently supports only [version 0.0.4](https://github.com/elastic/beats/blob/main/metricbeat/helper/prometheus/textparse.go#L44) of the plain.text content type.
Add support for version 0.0.1 as well. Currently if this version is used, it actually doesn't parse this version and fallback to the fallback scrape protocol.
Also ensure that the content types are actually similar to the [Prometheus Content Types](https://github.com/prometheus/prometheus/blob/edbc5cfa06e1e199861474a8ab1d8f7753efbf61/config/config.go#L535).
Contributor guide
Research direction
Start in metricbeat/helper/prometheus/textparse.go, especially the content-type handling around the linked version 0.0.4 definition. Compare the supported values with Prometheus's content types in config.go, then verify that version 0.0.1 is parsed instead of falling back to the fallback scrape protocol. Done means both plain.text versions are handled consistently with Prometheus.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, prometheus
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100