Closed Gerrard-YNWA closed 3 years ago
Thanks for the report! The library is deliberately restricting label values to ASCII characters following #21.
I agree that it would be nice to find a way to extend the allowed range of values to all valid UTF-8. Perhaps adapting code from utf8_validator.lua as a sanitizer could work: if provided label values contain invalid utf-8 characters, we'd simply use a truncated value (that could be an empty string).
Did you just want to report this, @Gerrard-YNWA, or are you planning to send a PR?
Thanks for explaining. Agree with allowing all the valid UTF-8 characters for label values and let me have a try.
Hello, I found the label_values is not fully supported UTF-8.
Here is the minimal case:
got the following output and
error_msg
was strippedIt seems that the
full_metric_name
https://github.com/knyar/nginx-lua-prometheus/blob/master/prometheus.lua#L94 takes all label values as one byte and strips all the noprintable ascii charachers.