diff --git a/.github/workflows/1.7.yaml b/.github/workflows/1.7.yaml index d980a9586b0..39859235173 100644 --- a/.github/workflows/1.7.yaml +++ b/.github/workflows/1.7.yaml @@ -148,7 +148,7 @@ jobs: with: go-version: '1.16' # The Go version to download (if necessary) and use. - - uses: azure/setup-helm@v2.0 + - uses: azure/setup-helm@v3.5 id: install - run: go mod download diff --git a/.github/workflows/1.8.yaml b/.github/workflows/1.8.yaml index b8e9e0d2f4b..c020a03b650 100644 --- a/.github/workflows/1.8.yaml +++ b/.github/workflows/1.8.yaml @@ -152,7 +152,7 @@ jobs: with: go-version: '1.16' # The Go version to download (if necessary) and use. - - uses: azure/setup-helm@v2.0 + - uses: azure/setup-helm@v3.5 id: install - run: go mod download diff --git a/.github/workflows/benchmark-run-master.yaml b/.github/workflows/benchmark-run-master.yaml index 34c53083b22..eef026fff78 100644 --- a/.github/workflows/benchmark-run-master.yaml +++ b/.github/workflows/benchmark-run-master.yaml @@ -114,7 +114,7 @@ jobs: with: go-version: '1.16' # The Go version to download (if necessary) and use. - - uses: azure/setup-helm@v2.0 + - uses: azure/setup-helm@v3.5 id: install - run: go mod download diff --git a/.github/workflows/call-test-images.yaml b/.github/workflows/call-test-images.yaml index 45ec572d2ae..e69909ff49d 100644 --- a/.github/workflows/call-test-images.yaml +++ b/.github/workflows/call-test-images.yaml @@ -185,7 +185,7 @@ jobs: uses: helm/kind-action@v1.2.0 - name: Set up Helm - uses: azure/setup-helm@v2.0 + uses: azure/setup-helm@v3.5 with: version: v3.6.3 diff --git a/plugins/out_datadog/datadog.c b/plugins/out_datadog/datadog.c index f684842776c..8d903753c20 100644 --- a/plugins/out_datadog/datadog.c +++ b/plugins/out_datadog/datadog.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -354,7 +355,11 @@ static void cb_datadog_flush(struct flb_event_chunk *event_chunk, FLB_OUTPUT_RETURN(FLB_ERROR); } + /* Add the required headers to the URI */ flb_http_add_header(client, "User-Agent", 10, "Fluent-Bit", 10); + flb_http_add_header(client, FLB_DATADOG_API_HDR, sizeof(FLB_DATADOG_API_HDR) - 1, ctx->api_key, flb_sds_len(ctx->api_key)); + flb_http_add_header(client, FLB_DATADOG_ORIGIN_HDR, sizeof(FLB_DATADOG_ORIGIN_HDR) - 1, "Fluent-Bit", 10); + flb_http_add_header(client, FLB_DATADOG_ORIGIN_VERSION_HDR, sizeof(FLB_DATADOG_ORIGIN_VERSION_HDR) - 1, FLB_VERSION_STR, sizeof(FLB_VERSION_STR) - 1); flb_http_add_header(client, FLB_DATADOG_CONTENT_TYPE, sizeof(FLB_DATADOG_CONTENT_TYPE) - 1, FLB_DATADOG_MIME_JSON, sizeof(FLB_DATADOG_MIME_JSON) - 1); diff --git a/plugins/out_datadog/datadog.h b/plugins/out_datadog/datadog.h index abcf8d26952..1ca2d6f058a 100644 --- a/plugins/out_datadog/datadog.h +++ b/plugins/out_datadog/datadog.h @@ -36,6 +36,10 @@ #define FLB_DATADOG_REMAP_PROVIDER "ecs" #define FLB_DATADOG_TAG_SEPERATOR "," +#define FLB_DATADOG_API_HDR "DD-API-KEY" +#define FLB_DATADOG_ORIGIN_HDR "DD-EVP-ORIGIN" +#define FLB_DATADOG_ORIGIN_VERSION_HDR "DD-EVP-ORIGIN-VERSION" + #define FLB_DATADOG_CONTENT_TYPE "Content-Type" #define FLB_DATADOG_MIME_JSON "application/json" diff --git a/plugins/out_datadog/datadog_conf.c b/plugins/out_datadog/datadog_conf.c index 3ddad3e276b..def064c48c5 100644 --- a/plugins/out_datadog/datadog_conf.c +++ b/plugins/out_datadog/datadog_conf.c @@ -115,14 +115,13 @@ struct flb_out_datadog *flb_datadog_conf_create(struct flb_output_instance *ins, ctx->remap = tmp && (strlen(tmp) == strlen(FLB_DATADOG_REMAP_PROVIDER)) && \ (strncmp(tmp, FLB_DATADOG_REMAP_PROVIDER, strlen(tmp)) == 0); - ctx->uri = flb_sds_create("/v1/input/"); + ctx->uri = flb_sds_create("/api/v2/logs"); if (!ctx->uri) { flb_plg_error(ctx->ins, "error on uri generation"); flb_datadog_conf_destroy(ctx); return NULL; } - /* Add the api_key to the URI */ - ctx->uri = flb_sds_cat(ctx->uri, ctx->api_key, flb_sds_len(ctx->api_key)); + flb_plg_debug(ctx->ins, "uri: %s", ctx->uri); /* Get network configuration */ diff --git a/plugins/out_datadog/datadog_conf.h b/plugins/out_datadog/datadog_conf.h index a4547ba5e9a..057a5e5f2dc 100644 --- a/plugins/out_datadog/datadog_conf.h +++ b/plugins/out_datadog/datadog_conf.h @@ -21,7 +21,7 @@ #define FLB_OUT_DATADOG_CONF_H #include -#include +#include #include "datadog.h"