Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

capture: add support for the /batch request shape #21

Merged
merged 5 commits into from
Apr 22, 2024
Merged

Conversation

xvello
Copy link
Contributor

@xvello xvello commented Apr 17, 2024

Can be reviewed commit by commit as some code is moved around before being modified

  • Mark the existing endpoint code v0 with goal of being as django-compatible as reasonable. We should then start a separate v1 endpoint with less debt. Move some code around to make navigation easier
  • Increase trace metadata for better debugging when we mirror traffic
  • Add a node-js /batch request as test fixture and make it pass. Note that the node SDK has a second form submission type that uses lz compression 🤦 but they seem to be going to /e/ anyway, not /batch
    • Keep the RawRequest instead of directly extracting events from it
    • Allow to get the token, sent_at and is_historical from the RawRequest body, to support the /batch fields. The is_historical might morph into a more generic data_type metadata down the road?
    • for now only covered by the django_compat.rs, will add end2end tests when I implement the is_historical handling in another PR
  • There's still TODOs (routing to historical topic, specifying offset), but good enough to start mirroring traffic and checking errors
  • Accept traffic on the /batch and /e endpoints, others will be added later on

@xvello xvello changed the title Add support for the /batch request shape, refacto token extraction capture: add support for the /batch request shape Apr 17, 2024
@xvello xvello requested a review from a team April 22, 2024 11:40
@xvello xvello marked this pull request as ready for review April 22, 2024 11:41
Copy link
Contributor

@tomasfarias tomasfarias left a comment

Choose a reason for hiding this comment

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

lgtm to start mirroring traffic 👍

@xvello xvello merged commit 4db3670 into main Apr 22, 2024
4 checks passed
@xvello xvello deleted the xvello/batch branch April 22, 2024 15:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants