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
2 changes: 1 addition & 1 deletion .github/workflows/call-build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
working-directory: packaging

- name: Upload the ${{ matrix.distro }} artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: packages-${{ inputs.version }}-${{ steps.formatted_distro.outputs.replaced }}
path: packaging/packages/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call-integration-image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
shell: bash

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: pr-${{ github.event.pull_request.number }}-image
path: /tmp/pr-image.tar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron-scorecards-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
publish_results: true

- name: "Upload artifact"
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: SARIF file
path: scorecard-results.sarif
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron-trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

# In case we need to analyse the uploaded files for some reason.
- name: Detain results for debug if needed
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: trivy-results-${{ matrix.local_tag }}.sarif
path: trivy-results-${{ matrix.local_tag }}.sarif
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-fuzz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
dry-run: false
language: c
- name: Upload Crash
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
working-directory: build

- name: Upload build packages
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: windows-packages
path: |
Expand All @@ -73,7 +73,7 @@ jobs:
docker save -o windows-${{ github.sha }}.tar fluent/fluent-bit:windows-${{ github.sha }}

- name: Upload containers
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: windows-containers
path: windows-${{ github.sha }}.tar
Expand Down
5 changes: 5 additions & 0 deletions plugins/out_datadog/datadog.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <fluent-bit/flb_time.h>
#include <fluent-bit/flb_gzip.h>
#include <fluent-bit/flb_config_map.h>
#include <fluent-bit/flb_version.h>

#include <msgpack.h>

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions plugins/out_datadog/datadog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 2 additions & 3 deletions plugins/out_datadog/datadog_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion plugins/out_datadog/datadog_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define FLB_OUT_DATADOG_CONF_H

#include <fluent-bit/flb_output.h>
#include <fluent-bit/flb_config.h>
#include <fluent-bit/flb_config.h>

#include "datadog.h"

Expand Down