• /
  • Log in

JSON message is not parsed


When JSON content is sent in the message field, it's not automatically parsed and is not being stored as attributes (key-value pairs). Instead, the content remains in the message. It also may be truncated if the message exceeds the character limit.


Reasons this may be happening:

  • If the content is not a valid JSON, it won't be parsed. Instead it will be stored as a string and truncated if it exceeds the character limit.
  • The content is a valid JSON but "stringified" with escape characters. If that's the case, it will first be evaluated as a string, meaning that it will be truncated to 4096 characters before being evaluated as JSON. The result of the truncation will be invalid JSON, and the data will be stored as a string.

To solve this problem: send messages containing JSON that haven't been converted to a string. This content will be parsed even if the total length exceeds the character limit. If the JSON contains arrays, they'll be flattened and stored as unparsed strings.

For more help

If you need more help, check out these support and learning resources:

Create issueEdit page
Copyright © 2021 New Relic Inc.