Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replays): Add additional safety to tags processor #3354

Merged
merged 3 commits into from
Nov 8, 2022

Conversation

cmanallen
Copy link
Member

closes: https://github.com/getsentry/replay-backend/issues/194

  • Add upper limit to the number of tags accepted per request.
  • Enforces non-null string keys.
  • Enforces nullable string values.
  • Preserves duplicate tag keys (supported by the replays product).
  • Skips (instead of erring on) malformed tag tuples.

@cmanallen cmanallen requested a review from a team as a code owner November 7, 2022 20:26
@cmanallen cmanallen changed the title feat(replays): Replays tags processor feat(replays): Add additional safety to tags processor Nov 7, 2022
Copy link
Member

@evanh evanh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preserves duplicate tag keys (supported by the replays product).

While you can certainly store duplicate tag keys, I don't know that this will actually work in practice. Queries against the tags in Snuba are transformed into something equivalent to tags.values[indexOf(tags.keys, <value>)]. If you are storing duplicate tag keys, you will only ever get the first value in the array when you query the tags.

Otherwise this looks fine to me.

@cmanallen
Copy link
Member Author

cmanallen commented Nov 8, 2022

@evanh Replays uses its own tags filtering technique so this shouldn't be a problem. We display tags like {"key": [value1, value2]} so we wrote filters to accommodate that.

@cmanallen cmanallen merged commit 9575a07 into master Nov 8, 2022
@cmanallen cmanallen deleted the replays-tags-processor branch November 8, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants