You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prometheus formatter should escape '"' and other characters and degrade gracefully when it cannot #18589
If a new StasScope is created by a filter with a number of dimensions, and one of the dimensions has a " inside the value, the Prometheus formatter ends up producing invalid prometheus output at /stats/prometheus .
Prometheus formatter should not produce invalid prometheus output regardless of the input.
Since prometheus-text is a line oriented format, if a valid encoding cannot be generated, the line should be elided, with some comment indicating that this has happened.
Escape " as '"` in the output
example when path=/foor"bar
request_total{path="/foo"bar"} 250
The above line is not parseable.
One could argue that Prometheus scraper should degrade gracefully by only discarding lines that cannot be parsed.
Per envoy trust model, stats are not supposed to take untrusted data path values. There's also invalid utf-8 issue since envoy will pass latin1 bytes through and break scraping.
Activity
mandarjog commentedon Oct 12, 2021
cc @jmarantz
kyessenov commentedon Oct 12, 2021
Per envoy trust model, stats are not supposed to take untrusted data path values. There's also invalid utf-8 issue since envoy will pass latin1 bytes through and break scraping.
stats(prometheus): escape problematic chars in text serialization (#1…