Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion plugins/out_bigquery/bigquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,9 @@ static int cb_bigquery_init(struct flb_output_instance *ins,
flb_sds_destroy(token);
}

/* Setup HTTP debug callbacks */
flb_output_set_http_debug_callbacks(ins);

return 0;
}

Expand Down Expand Up @@ -1014,13 +1017,16 @@ static void cb_bigquery_flush(struct flb_event_chunk *event_chunk,
FLB_OUTPUT_RETURN(FLB_RETRY);
}

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

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

/* Enable HTTP client debug callbacks */
flb_http_client_debug(c, ctx->ins->callback);

/* Send HTTP request */
ret = flb_http_do(c, &b_sent);

Expand Down Expand Up @@ -1143,6 +1149,11 @@ static struct flb_config_map config_map[] = {
0, FLB_TRUE, offsetof(struct flb_bigquery, ignore_unknown_values),
"Enable ignoring unknown value",
},
{
FLB_CONFIG_MAP_INT, "buffer_size", "4192",
0, FLB_TRUE, offsetof(struct flb_bigquery, buffer_size),
"Set the HTTP buffer size",
},
/* EOF */
{0}
};
Expand Down
1 change: 1 addition & 0 deletions plugins/out_bigquery/bigquery.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ struct flb_bigquery {

int skip_invalid_rows;
int ignore_unknown_values;
int buffer_size;

flb_sds_t uri;

Expand Down