client_python icon indicating copy to clipboard operation
client_python copied to clipboard

UTF-8: Implement support in Python client library

Open ywwg opened this issue 1 year ago • 3 comments

As in https://github.com/prometheus/client_golang/issues/1369 and https://github.com/prometheus/client_java/issues/916, the Python library needs to be updated to support UTF-8.

Tasks:

  • [x] Update exposition format parsers for the new syntax
  • [x] Update PromQL parsers (if any) for the new syntax
  • [ ] Update content negotiation logic
  • [ ] Add flag to enable change in validation logic to check that metric and label names are UTF-8 valid instead of the old letters/numbers/underscores/colons set

For background and references see https://github.com/prometheus/prometheus/issues/13095

ywwg avatar Mar 05 '24 16:03 ywwg

I will take this

ywwg avatar Oct 16 '24 14:10 ywwg

A lot of the existing python parser does not at all take into account quoted characters and makes many calls to .index, .find, and regex matches that ignore quoted characters. This will break today if label values contain things like {, }, and =. So, this change will require a lot of rewriting to protect the existing code against such issues before it can even be updated to support quoted names

ywwg avatar Oct 31 '24 17:10 ywwg

still need to do content negotiation!

ywwg avatar Feb 12 '25 20:02 ywwg