-
Notifications
You must be signed in to change notification settings - Fork 490
bigquery()
: add batch-bytes()
#4756
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
Conversation
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
This Pull Request introduces config grammar changessyslog-ng/a0eeab6bda21cc29dc73a56b468dff8a6947b8ca -> alltilla/bigquery-batch-bytes --- a/destination
+++ b/destination
bigquery(
+ batch-bytes(<positive-integer>)
)
|
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.
This looks good to me. I had just one question but I'm fine with being this as is
54c2852
to
6cef03d
Compare
Added a comment to the code: /*
* We check the last added row instead of storing it in a variable, checking its size then adding it to the batch,
* because if we did that, add_serialized_rows() would copy the std::string instead of moving it, which hurts perf.
*/ |
6cef03d
to
7efbdcd
Compare
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Unfortunately, currently only the legacy CSV stats output shows these counters. Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
7efbdcd
to
e9c7850
Compare
Thanks to @OverOrion, I managed to make it cleaner with |
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.
LGTM, thanks for this!
BigQuery does not let us send a batch with more than 10 MB data: https://cloud.google.com/bigquery/quotas#write-api-limits
The new
batch-bytes()
option let's the user set an upper bytes size limit of the batch. By default it is 10 MB, and syslog-ng does not let the user set a larger value.Please note that due to a framework limitation, the batch is possible to be at most 1 message larger than the set limit. You can set this limit to a lower value, but BigQuery never dropped a batch because of this in my manual E2E tests. This might be because maybe Google meant 10 MiB as the limit not 10 MB, but we are following what the doc says.
Example config:
New stats are also added to the legacy CSV output:
No news file needed as
bigquery()
was not released in a stable version, yet.