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
It would be very useful to have an option/flag in json_exporter to parse responses where the body is a raw JSON string, but the string content itself is a JSON object .
For example, this works fine when the response is a normal JSON object:
So the response is valid JSON, but the root value is a string, and that string contains a serialized JSON object.
Note
This issue is particularly relevant for legacy systems or APIs that might return stringified JSON due to historical reasons, simplicity in storage, or specific data transfer protocols. In such systems, it would be beneficial for json_exporter to support the parsing of these types of responses.
Could you add a flag to make json_exporter decode that inner JSON string before applying JSONPath?
Something like parse_embedded_json: true; Example Idea:
Hi,
It would be very useful to have an option/flag in
json_exporterto parse responses where the body is a raw JSON string, but the string content itself is a JSON object .For example, this works fine when the response is a normal JSON object:
{"latest_datapoint_creation_height":1737045, "latest_datapoint":3134069212}But in my case, the endpoint returns something like this instead:
"{\"latest_datapoint_creation_height\":1737045,\"latest_datapoint\":3134069212}"So the response is valid JSON, but the root value is a string, and that string contains a serialized JSON object.
Note
This issue is particularly relevant for legacy systems or APIs that might return
stringified JSONdue to historical reasons, simplicity in storage, or specific data transfer protocols. In such systems, it would be beneficial forjson_exporterto support the parsing of these types of responses.Could you add a flag to make
json_exporterdecode that inner JSON string before applying JSONPath?Something like
parse_embedded_json: true; Example Idea:Expected behavior:
This would help with endpoints that return JSON objects wrapped as raw JSON strings, without needing an extra preprocessing service.
Thanks.