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

out_azure_kusto: added default kusto endpoints connection timeout interval configs #8361

Closed
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
6 changes: 6 additions & 0 deletions plugins/out_azure_kusto/azure_kusto.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ flb_sds_t execute_ingest_csl_command(struct flb_azure_kusto *ctx, const char *cs
struct flb_http_client *c;
flb_sds_t resp = NULL;

/* setting default connection timeout to kusto ingest endpoint */
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout;

/* Get upstream connection */
u_conn = flb_upstream_conn_get(ctx->u);

Expand Down Expand Up @@ -462,6 +465,9 @@ static struct flb_config_map config_map[] = {
offsetof(struct flb_azure_kusto, time_key),
"The key name of the time. If 'include_time_key' is false, "
"This property is ignored"},
{FLB_CONFIG_MAP_TIME, "kusto_endpoint_connection_timeout", FLB_AZURE_KUSTO_INGEST_ENDPOINT_CONNECTION_TIMEOUT, 0, FLB_TRUE,
offsetof(struct flb_azure_kusto, kusto_endpoint_connection_timeout),
"Set the connection timeout of various kusto endpoints (kusto ingest endpoint, kusto ingestion blob endpoint, kusto ingestion blob endpoint) in seconds"},
/* EOF */
{0}};

Expand Down
5 changes: 5 additions & 0 deletions plugins/out_azure_kusto/azure_kusto.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

#define FLB_AZURE_KUSTO_RESOURCES_LOAD_INTERVAL_SEC 3600

#define FLB_AZURE_KUSTO_INGEST_ENDPOINT_CONNECTION_TIMEOUT "60"

struct flb_azure_kusto_resources {
struct flb_upstream_ha *blob_ha;
struct flb_upstream_ha *queue_ha;
Expand All @@ -70,6 +72,9 @@ struct flb_azure_kusto {
flb_sds_t table_name;
flb_sds_t ingestion_mapping_reference;

/* connection configuration */
int kusto_endpoint_connection_timeout;

/* records configuration */
flb_sds_t log_key;
int include_tag_key;
Expand Down
6 changes: 6 additions & 0 deletions plugins/out_azure_kusto/azure_kusto_ingest.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ static flb_sds_t azure_kusto_create_blob(struct flb_azure_kusto *ctx, flb_sds_t
return NULL;
}

/* setting default connection timeout to kusto azure blob endpoint */
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout;

u_conn = flb_upstream_conn_get(u_node->u);

if (u_conn) {
Expand Down Expand Up @@ -348,6 +351,9 @@ static int azure_kusto_enqueue_ingestion(struct flb_azure_kusto *ctx, flb_sds_t
return -1;
}

/* setting default connection timeout to kusto azure queue endpoint */
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout;

u_conn = flb_upstream_conn_get(u_node->u);

if (u_conn) {
Expand Down