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
Prometheus can only deal with floats written with a dot (2.20 in en_EN for example). However if a project is set to use ru_RU, floats are written with a comma.
<?phpsetlocale(LC_NUMERIC, 'en_EN');
printf("%f\n", 2.22); // prints 2.220000 which is correctsetlocale(LC_NUMERIC, 'ru_RU');
printf("%f\n", 2.22); // prints 2,220000 which is not correct
It's not only when rendering.
The APC.php storage handler has a function histogramBucketValueKey that just converts the float to string for naming the buckets, which causes the bucket to not be updated if the float is rendered with comma.
Prometheus can only deal with floats written with a dot (
2.20
inen_EN
for example). However if a project is set to useru_RU
, floats are written with a comma.This can be fixed dropping the locale to
C
and returning it back after stringifying. Symfony guys fixed it in the VarDumper component here https://github.com/symfony/symfony/pull/23575/files .Of course a project can drop locale when rendering the metrics, but IMO this should be handled by the library.
The text was updated successfully, but these errors were encountered: