When utf8 mode is enabled in prometheus, it can be overridden on a per-scrape config basis. While setting this override does change the content negotiation, the code does not actually validate the names at scrape time. We need to figure out where the name validation is done and then switch validation type depending on the scrapeconfig setting.
There are four places where model.IsValidMetricName is checked:
- rulefmt.go: this probably does not need to change, it's a formatter
- protobufparse.go: this may also be fine?
- codec.go: this is on the query side, so shouldn't be connected to scrape configs
- labels_common.go: probably the one that needs to be fixed
part of #13095
We'll need a test to exercise the bug