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
The prometheus ToString(double) calls std::to_string which if you're running in a non-english locale and you've called setlocale (which in our case initializing a in-process JVM will do) can format numbers to be: 123,45 rather than 123.45.
For formatting the output of /metrics I think it needs to always be .-format and not locale-dependent, so you need to use a different mechanism (it looks like getting an ostringstream and calling imbue on it to force a C locale is probably simplest)
The prometheus ToString(double) calls std::to_string which if you're running in a non-english locale and you've called setlocale (which in our case initializing a in-process JVM will do) can format numbers to be: 123,45 rather than 123.45.
For formatting the output of /metrics I think it needs to always be .-format and not locale-dependent, so you need to use a different mechanism (it looks like getting an ostringstream and calling imbue on it to force a C locale is probably simplest)
To demonstrate outside of prometheus use:
To demonstrate with prometheus-cpp just call std::locale::global(std::locale(""));
Unfortunately leaving the global locale set to C isn't an option because loading a JVM with the invocation API in the same process seems to do that.
The text was updated successfully, but these errors were encountered: