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

Extract HTTP ingestion API interactions and refactor #160

Merged
merged 7 commits into from
Nov 5, 2021

Conversation

nblumhardt
Copy link
Member

@nblumhardt nblumhardt commented Nov 4, 2021

Gets us into a better position for testing significant changes and future additions :-)

SeqIngestionApi now provides a (very thin) abstraction over the POSTs to the ingestion endpoint. This gets a lot of duplication out of the sinks, and makes unit testing the sinks (and eventually HttpLogShipper) easier.

I haven't tried to completely abstract away the HTTP-dependent aspect of this, since there's not currently any great benefit from doing so, and we'll end up having to clutter the code up by defining our own equivalents of HTTP status codes etc.

There are only two behavioral changes here (that I know of) which deserve a call-out.

Response bodies will no longer be written to SelfLog by the durable sink when logging fails. Done for simplification; the ingestion log should cover this case, and we don't do it in batched or audit mode, so seems reasonable to stop doing it in durable mode.

If we want to add this back for additional diagnostics, providing some hooks at the top level for handling failed ingestion response bodies would be better.

Audit sink writes will read the full response, though they'll discard it. Probably irrelevant, since the responses are tiny and would more than likely have been buffered in the network stack before the response reaches us.

@nblumhardt nblumhardt marked this pull request as ready for review November 4, 2021 03:51
@KodrAus KodrAus merged commit 76e9a9b into datalust:dev Nov 5, 2021
@nblumhardt nblumhardt mentioned this pull request Nov 5, 2021
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