-
Notifications
You must be signed in to change notification settings - Fork 9
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/batch templating #347
Conversation
321429f
to
a80ea8d
Compare
01a5aba
to
4631cc7
Compare
for _, msg := range goodMsgs { | ||
msg.TimeRequestStarted = requestStarted | ||
msg.TimeRequestFinished = requestFinished | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting you do this even if err != nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's most valuable if err != nil! We introduced it on request from Tech Ops, because it tells us when lag/issues are most likely external :)
4631cc7
to
853d9aa
Compare
provideRequestBody can't be compatible with plain strings and play nicely with our data. This commit changes it to expect a JSON - if there is some use case for plain strings it can still be done via a transformation + a template.
Won't be exact but will err on the side of caution since the template file's data will be _slightly_ bigger than the empty template.
853d9aa
to
07dc64e
Compare
Refactors the HTTP target to handle batches of data in one go, adds the ability to provide a template to get those batches of data into a request body, and adds a helper function to cover the case where there is no template provided. This involves breaking changes - the previous behaviour can be achieved by configuring a template if the data is already JSON, or a transformation + a template if not - but we don't believe there are any use cases requiring us to do so. - Refactors the http target to handle batches - Adds configuration of batch sizes for http target - Adds a templater function - Adds a helper function which creates a JSON array from the data where no template is provided - Adds a function to group data by dynamic headers where that is configured - to ensure that this feature still works - Adds tests for these features These features also introduce a new possibility for failure in the HTTP target. The http target now expects valid JSON (previously it could be anything) - where we hit an error in either templating this data - or in the case of no template in transforming the data into a JSON array request body - these messages are treated as invalid, and will be sent to the failure target. --------- Co-authored-by: Piotr Poniedziałek <[email protected]>
Refactors the HTTP target to handle batches of data in one go, adds the ability to provide a template to get those batches of data into a request body, and adds a helper function to cover the case where there is no template provided. This involves breaking changes - the previous behaviour can be achieved by configuring a template if the data is already JSON, or a transformation + a template if not - but we don't believe there are any use cases requiring us to do so. - Refactors the http target to handle batches - Adds configuration of batch sizes for http target - Adds a templater function - Adds a helper function which creates a JSON array from the data where no template is provided - Adds a function to group data by dynamic headers where that is configured - to ensure that this feature still works - Adds tests for these features These features also introduce a new possibility for failure in the HTTP target. The http target now expects valid JSON (previously it could be anything) - where we hit an error in either templating this data - or in the case of no template in transforming the data into a JSON array request body - these messages are treated as invalid, and will be sent to the failure target. --------- Co-authored-by: Piotr Poniedziałek <[email protected]>
Refactors the HTTP target to handle batches of data in one go, adds the ability to provide a template to get those batches of data into a request body, and adds a helper function to cover the case where there is no template provided. This involves breaking changes - the previous behaviour can be achieved by configuring a template if the data is already JSON, or a transformation + a template if not - but we don't believe there are any use cases requiring us to do so. - Refactors the http target to handle batches - Adds configuration of batch sizes for http target - Adds a templater function - Adds a helper function which creates a JSON array from the data where no template is provided - Adds a function to group data by dynamic headers where that is configured - to ensure that this feature still works - Adds tests for these features These features also introduce a new possibility for failure in the HTTP target. The http target now expects valid JSON (previously it could be anything) - where we hit an error in either templating this data - or in the case of no template in transforming the data into a JSON array request body - these messages are treated as invalid, and will be sent to the failure target. --------- Co-authored-by: Piotr Poniedziałek <[email protected]>
Refactors the HTTP target to handle batches of data in one go, adds the ability to provide a template to get those batches of data into a request body, and adds a helper function to cover the case where there is no template provided.
This involves breaking changes - the previous behaviour can be achieved by configuring a template if the data is already JSON, or a transformation + a template if not - but we don't believe there are any use cases requiring us to do so.
These features also introduce a new possibility for failure in the HTTP target. The http target now expects valid JSON (previously it could be anything) - where we hit an error in either templating this data - or in the case of no template in transforming the data into a JSON array request body - these messages are treated as invalid, and will be sent to the failure target.