add custom data to the correct payload key #473
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
The PR writes
extra_data
to thecustom
key of the payload as specified in the payload schema: https://docs.rollbar.com/reference/create-itemPyrollbar exception payloads already do this correctly, and the change only affects message payloads. The impact of the current bug is that the custom data is discarded in the pipeline, doesn't get stored or indexed with the occurrence, and therefore cannot be searched.
This PR treats the change as non-breaking, since the custom data can currently only be found in the raw json of the occurrence, and is discarded everywhere else. One example where this is used is the "Params" section of the item detail page in the Rollbar app. After this change, the custom data would still be visible there, but with key names consistent with other items.
If we do consider this a breaking change and want to avoid that, the PR can be updated to write the data in both places, with the tradeoff of a larger payload.
Update:
Updated to preserve the previous location, to be on the side of caution re. the breaking behavior.
Type of change
Development
Code review