-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Proposal
Currently the metric_name_validation_scheme is the only setting in prometheus for controlling what kind of escaping will be requested through the Accept header. when set to "utf-8" it requests escaping=allow-utf-8, and when set to "legacy" it requests whatever the default escaping scheme is set in prom/common, which is currently "underscores". There should be another config option to select the other possible escaping schemes, "dots" and "values".
Furthermore, this feature is gaining urgency because of user confusion about otel suddenly sending dots when upgrading prometheus. This confusion likely stems from lack of visibility of changes, but also that the new features are about validation and don't correctly communicate that the validation method drives the content negotiation request.
see: https://cloud-native.slack.com/archives/C01AUBA4PFE/p1740064192288759
So I plan to add a new config value alongside metric_name_validation_scheme
that is metric_name_escaping_scheme
. By default, it will be "underscores" if the validation scheme is legacy, and "allow-utf-8" if the validation scheme is utf8. This means there is no change from current behavior with the same config. (The validation scheme has already changed default value). If users wish to allow utf-8 but request underscores, they can, or they can disable utf-8 support altogether.
Update:
I realize we also need a way to do this for remote write content negotiation, for which there is no "scaper config". And the otel endpoint (does that even do content negotiation?)
- Escaping scheme request for scraping
- escaping scheme request for remote write
- escaping scheme request for otel endpoint