From 27adf4cc228bc9efd66e6c17fda19ccc0628cddb Mon Sep 17 00:00:00 2001 From: kolossi Date: Thu, 5 Sep 2024 14:42:45 +0100 Subject: [PATCH] [Addon] Fix for datadog trait logging source setup when serviceName differs from component name --- experimental/addons/datadog/definitions/datadog.cue | 4 ++-- experimental/addons/datadog/metadata.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/experimental/addons/datadog/definitions/datadog.cue b/experimental/addons/datadog/definitions/datadog.cue index bc6864ed..ec71d153 100644 --- a/experimental/addons/datadog/definitions/datadog.cue +++ b/experimental/addons/datadog/definitions/datadog.cue @@ -76,7 +76,7 @@ template: { let sourceAnnotation = { if parameter.source != _|_ { metadata: annotations: { - ("ad.datadoghq.com/"+parameter.serviceName+".logs"): "[{\"source\": \""+parameter.source+"\"}]" + ("ad.datadoghq.com/"+context.name+".logs"): "[{\"source\": \""+parameter.source+"\"}]" } } } @@ -135,7 +135,7 @@ template: { // +usage=name of host mount volume (default datadog) volumeName: *"datadog" | string - // +usage=source for logging - added as an annotation 'ad.datadoghq.com/.logs: [{"source":""}]', and if logDirectSubmissionIntegrations is given, also assigned to DD_LOGS_DIRECT_SUBMISSION_SOURCE env var. + // +usage=source for logging - added as an annotation 'ad.datadoghq.com/.logs: [{"source":""}]', and if logDirectSubmissionIntegrations is given, also assigned to DD_LOGS_DIRECT_SUBMISSION_SOURCE env var. source?: string // +usage=auto-map standard dependencies to -dependency by setting DD_TRACE_SERVICE_MAPPING env var (default false) diff --git a/experimental/addons/datadog/metadata.yaml b/experimental/addons/datadog/metadata.yaml index b1b07034..51a6d08b 100644 --- a/experimental/addons/datadog/metadata.yaml +++ b/experimental/addons/datadog/metadata.yaml @@ -1,5 +1,5 @@ name: datadog -version: 0.0.4 +version: 0.0.5 system: vela: ">=v1.9.0" description: Sets up the annotations and environment variables to assist a webservice or cron-task component to have correct collection of logs and apm stats by a datadog agent installed on the host nodes.