php-fpm_exporter icon indicating copy to clipboard operation
php-fpm_exporter copied to clipboard

Escape all string values in broken json from php-fpm status

Open jvrsantacruz opened this issue 2 years ago • 2 comments

php-fpm status page sends a broken json where string values are not escaped. eg: "user":"myval\srv_monitor"

There is a current fix in place specifically for the request uri field. This pull request extends this fix to all string fields in the JSON response.

The problem with broken JSON is that only with regexes we cannot reliably split the JSON and extract the strings. The strategy is to break down the string to get the values between field names in the form "user":, detect the values that are of type string and apply the same json.Marshall escaping.

Should fix #258 and #291

jvrsantacruz avatar Mar 24 '23 17:03 jvrsantacruz

Hi there! :-)

Is there anything else missing in the PR? I'd be more than happy to fix whatever is needed. We're currently using a fork in our production environments and it's not ideal.

Thank you!

jvrsantacruz avatar Jul 12 '23 22:07 jvrsantacruz

Hi! :-)

Is there something that I can/need to add to the branch so it can be released?

jvrsantacruz avatar Sep 04 '23 09:09 jvrsantacruz