Skip to content

Commit 44deb46

Browse files
committed
out_bigquery: make HTTP buffer size configurable
Signed-off-by: Tsubasa Miyamoto <tsubasa.miyamoto@gmail.com>
1 parent f3e1342 commit 44deb46

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

plugins/out_bigquery/bigquery.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,9 @@ static int cb_bigquery_init(struct flb_output_instance *ins,
841841
flb_sds_destroy(token);
842842
}
843843

844+
/* Setup HTTP debug callbacks */
845+
flb_output_set_http_debug_callbacks(ins);
846+
844847
return 0;
845848
}
846849

@@ -1014,13 +1017,16 @@ static void cb_bigquery_flush(struct flb_event_chunk *event_chunk,
10141017
FLB_OUTPUT_RETURN(FLB_RETRY);
10151018
}
10161019

1017-
flb_http_buffer_size(c, 4192);
1020+
flb_http_buffer_size(c, ctx->buffer_size);
10181021
flb_http_add_header(c, "User-Agent", 10, "Fluent-Bit", 10);
10191022
flb_http_add_header(c, "Content-Type", 12, "application/json", 16);
10201023

10211024
/* Compose and append Authorization header */
10221025
flb_http_add_header(c, "Authorization", 13, token, flb_sds_len(token));
10231026

1027+
/* Enable HTTP client debug callbacks */
1028+
flb_http_client_debug(c, ctx->ins->callback);
1029+
10241030
/* Send HTTP request */
10251031
ret = flb_http_do(c, &b_sent);
10261032

@@ -1143,6 +1149,11 @@ static struct flb_config_map config_map[] = {
11431149
0, FLB_TRUE, offsetof(struct flb_bigquery, ignore_unknown_values),
11441150
"Enable ignoring unknown value",
11451151
},
1152+
{
1153+
FLB_CONFIG_MAP_INT, "buffer_size", "4192",
1154+
0, FLB_TRUE, offsetof(struct flb_bigquery, buffer_size),
1155+
"Set the HTTP buffer size",
1156+
},
11461157
/* EOF */
11471158
{0}
11481159
};

plugins/out_bigquery/bigquery.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ struct flb_bigquery {
110110

111111
int skip_invalid_rows;
112112
int ignore_unknown_values;
113+
int buffer_size;
113114

114115
flb_sds_t uri;
115116

0 commit comments

Comments
 (0)