From 9673f131831f4eb3c978d48ffafc7d74ab57101f Mon Sep 17 00:00:00 2001 From: mackjmr Date: Fri, 6 Sep 2024 15:22:40 +0200 Subject: [PATCH 1/6] [exporter/datadogexporter] Add support for custom log source This PR updates `github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter` to include commit: https://github.com/DataDog/datadog-agent/commit/09b07ebe76698d875721f6a482b5176ba2df7ed9. This adds support for setting a custom log source from resource attribute or log attribute `datadog.log.source`. --- .chloggen/mackjmr_custom-log-src-support.yaml | 27 +++++++++++++++++++ cmd/otelcontribcol/go.mod | 4 +-- cmd/otelcontribcol/go.sum | 4 +++ connector/datadogconnector/go.mod | 4 +-- connector/datadogconnector/go.sum | 8 +++--- exporter/datadogexporter/go.mod | 4 +-- exporter/datadogexporter/go.sum | 8 +++--- .../datadogexporter/integrationtest/go.mod | 4 +-- .../datadogexporter/integrationtest/go.sum | 8 +++--- 9 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 .chloggen/mackjmr_custom-log-src-support.yaml diff --git a/.chloggen/mackjmr_custom-log-src-support.yaml b/.chloggen/mackjmr_custom-log-src-support.yaml new file mode 100644 index 000000000000..a2048651cd0d --- /dev/null +++ b/.chloggen/mackjmr_custom-log-src-support.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: datadogexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add support for setting a custom log source from resource attribute or log attribute `datadog.log.source` + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 7c94e8a0fca6..f01debf74165 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -304,7 +304,7 @@ require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/def v0.56.2 // indirect @@ -829,7 +829,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 6eb093e27232..af866e833d3b 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -751,6 +751,8 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelin github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2/go.mod h1:hruCkJ5hCU6LZ5jkdnST3BHanHeQ73ewPAWIW/oZVmw= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 h1:gfpTFIkwgLNLCdbYRqMH91uwyvOKnIWMAqHJao0bWTE= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2/go.mod h1:VIWMWkwSq4vtJeI/saiNDFoeh3FdbKFca+YvbE7HCrE= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 h1:SVw998gOKBV4mkDdbhpEhDVNLR9aIssZHy9ZpsZdNFA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669/go.mod h1:niRElZ9+yd0uG84z4Az+da3JX9UpRu5MrbB32KtF4xI= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2 h1:TmEsHhs1mcKsiWTK08aYvZrNZqlbs51FwN6yQVMe7No= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2/go.mod h1:D56XSQiApc7kNzkF2FCJG/6D/8SV3jhdWqe0dDSRGoM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.56.2 h1:WTK6fTNgSCuVrz3dngS7R82rq9SVI+E8oQehd/2eEU0= @@ -2559,6 +2561,8 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index ae91101189c1..156a471b5795 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -50,7 +50,7 @@ require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/def v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.56.2 // indirect github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2 // indirect @@ -270,7 +270,7 @@ require ( go.uber.org/dig v1.17.1 // indirect go.uber.org/fx v1.18.2 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sys v0.24.0 // indirect diff --git a/connector/datadogconnector/go.sum b/connector/datadogconnector/go.sum index 84bf446d9ee7..7bbe636a448d 100644 --- a/connector/datadogconnector/go.sum +++ b/connector/datadogconnector/go.sum @@ -94,8 +94,8 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2 h1:SXJCw github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2/go.mod h1:0o4qKCsmoFkYSgOTKL5UMR1/Ig0pX4bA6gJZjuu8/K4= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2 h1:P1u8lJDnCHiWc0vvvvm9JB36fRFJ2eSvD9ajVo0x1r8= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2/go.mod h1:hruCkJ5hCU6LZ5jkdnST3BHanHeQ73ewPAWIW/oZVmw= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 h1:gfpTFIkwgLNLCdbYRqMH91uwyvOKnIWMAqHJao0bWTE= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2/go.mod h1:VIWMWkwSq4vtJeI/saiNDFoeh3FdbKFca+YvbE7HCrE= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 h1:SVw998gOKBV4mkDdbhpEhDVNLR9aIssZHy9ZpsZdNFA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669/go.mod h1:niRElZ9+yd0uG84z4Az+da3JX9UpRu5MrbB32KtF4xI= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2 h1:TmEsHhs1mcKsiWTK08aYvZrNZqlbs51FwN6yQVMe7No= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2/go.mod h1:D56XSQiApc7kNzkF2FCJG/6D/8SV3jhdWqe0dDSRGoM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.56.2 h1:WTK6fTNgSCuVrz3dngS7R82rq9SVI+E8oQehd/2eEU0= @@ -1065,8 +1065,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/exporter/datadogexporter/go.mod b/exporter/datadogexporter/go.mod index ebae665a7470..aeddd8468112 100644 --- a/exporter/datadogexporter/go.mod +++ b/exporter/datadogexporter/go.mod @@ -10,7 +10,7 @@ require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.2 github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2 github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2 github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.57.0-devel.0.20240718200853-81bf3b2e412d github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.56.2 @@ -361,7 +361,7 @@ require ( go.uber.org/fx v1.18.2 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect diff --git a/exporter/datadogexporter/go.sum b/exporter/datadogexporter/go.sum index 07f9d0cd2bd5..d6354ce7818c 100644 --- a/exporter/datadogexporter/go.sum +++ b/exporter/datadogexporter/go.sum @@ -101,8 +101,8 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2 h1:SXJCw github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2/go.mod h1:0o4qKCsmoFkYSgOTKL5UMR1/Ig0pX4bA6gJZjuu8/K4= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2 h1:P1u8lJDnCHiWc0vvvvm9JB36fRFJ2eSvD9ajVo0x1r8= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2/go.mod h1:hruCkJ5hCU6LZ5jkdnST3BHanHeQ73ewPAWIW/oZVmw= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 h1:gfpTFIkwgLNLCdbYRqMH91uwyvOKnIWMAqHJao0bWTE= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2/go.mod h1:VIWMWkwSq4vtJeI/saiNDFoeh3FdbKFca+YvbE7HCrE= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 h1:SVw998gOKBV4mkDdbhpEhDVNLR9aIssZHy9ZpsZdNFA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669/go.mod h1:niRElZ9+yd0uG84z4Az+da3JX9UpRu5MrbB32KtF4xI= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2 h1:TmEsHhs1mcKsiWTK08aYvZrNZqlbs51FwN6yQVMe7No= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2/go.mod h1:D56XSQiApc7kNzkF2FCJG/6D/8SV3jhdWqe0dDSRGoM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.56.2 h1:WTK6fTNgSCuVrz3dngS7R82rq9SVI+E8oQehd/2eEU0= @@ -1203,8 +1203,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index 5b8f748d4941..b5dac8a7fda2 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -57,7 +57,7 @@ require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.56.2 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/def v0.56.2 // indirect @@ -337,7 +337,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect diff --git a/exporter/datadogexporter/integrationtest/go.sum b/exporter/datadogexporter/integrationtest/go.sum index 6c85dd5eec13..6b8bf91f2a7e 100644 --- a/exporter/datadogexporter/integrationtest/go.sum +++ b/exporter/datadogexporter/integrationtest/go.sum @@ -99,8 +99,8 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2 h1:SXJCw github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2/go.mod h1:0o4qKCsmoFkYSgOTKL5UMR1/Ig0pX4bA6gJZjuu8/K4= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2 h1:P1u8lJDnCHiWc0vvvvm9JB36fRFJ2eSvD9ajVo0x1r8= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2/go.mod h1:hruCkJ5hCU6LZ5jkdnST3BHanHeQ73ewPAWIW/oZVmw= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 h1:gfpTFIkwgLNLCdbYRqMH91uwyvOKnIWMAqHJao0bWTE= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2/go.mod h1:VIWMWkwSq4vtJeI/saiNDFoeh3FdbKFca+YvbE7HCrE= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 h1:SVw998gOKBV4mkDdbhpEhDVNLR9aIssZHy9ZpsZdNFA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669/go.mod h1:niRElZ9+yd0uG84z4Az+da3JX9UpRu5MrbB32KtF4xI= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2 h1:TmEsHhs1mcKsiWTK08aYvZrNZqlbs51FwN6yQVMe7No= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2/go.mod h1:D56XSQiApc7kNzkF2FCJG/6D/8SV3jhdWqe0dDSRGoM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.56.2 h1:WTK6fTNgSCuVrz3dngS7R82rq9SVI+E8oQehd/2eEU0= @@ -1187,8 +1187,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= From 08df42a931e4bb5415d513dee72aeeb467ab4bc1 Mon Sep 17 00:00:00 2001 From: mackjmr Date: Fri, 6 Sep 2024 15:26:13 +0200 Subject: [PATCH 2/6] add issue # to changelog --- .chloggen/mackjmr_custom-log-src-support.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/mackjmr_custom-log-src-support.yaml b/.chloggen/mackjmr_custom-log-src-support.yaml index a2048651cd0d..7fa1420ad688 100644 --- a/.chloggen/mackjmr_custom-log-src-support.yaml +++ b/.chloggen/mackjmr_custom-log-src-support.yaml @@ -10,7 +10,7 @@ component: datadogexporter note: Add support for setting a custom log source from resource attribute or log attribute `datadog.log.source` # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. -issues: [] +issues: [35051] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. From fb1e8d7655e60d44165669f39fc7a164a49a38bd Mon Sep 17 00:00:00 2001 From: mackjmr Date: Fri, 6 Sep 2024 15:55:35 +0200 Subject: [PATCH 3/6] fix --- cmd/otelcontribcol/go.sum | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index af866e833d3b..43c44d1879c5 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -749,8 +749,6 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2 h1:SXJCw github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.2/go.mod h1:0o4qKCsmoFkYSgOTKL5UMR1/Ig0pX4bA6gJZjuu8/K4= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2 h1:P1u8lJDnCHiWc0vvvvm9JB36fRFJ2eSvD9ajVo0x1r8= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.56.2/go.mod h1:hruCkJ5hCU6LZ5jkdnST3BHanHeQ73ewPAWIW/oZVmw= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2 h1:gfpTFIkwgLNLCdbYRqMH91uwyvOKnIWMAqHJao0bWTE= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.2/go.mod h1:VIWMWkwSq4vtJeI/saiNDFoeh3FdbKFca+YvbE7HCrE= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669 h1:SVw998gOKBV4mkDdbhpEhDVNLR9aIssZHy9ZpsZdNFA= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240830150952-09b07ebe7669/go.mod h1:niRElZ9+yd0uG84z4Az+da3JX9UpRu5MrbB32KtF4xI= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.2 h1:TmEsHhs1mcKsiWTK08aYvZrNZqlbs51FwN6yQVMe7No= @@ -2559,8 +2557,6 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= From cd3d456b93150035ccaa79963e1a7716af15ca5d Mon Sep 17 00:00:00 2001 From: mackjmr Date: Fri, 6 Sep 2024 15:58:51 +0200 Subject: [PATCH 4/6] add Readme --- exporter/datadogexporter/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exporter/datadogexporter/README.md b/exporter/datadogexporter/README.md index ecb7c4341f6f..1dc08d9909bc 100644 --- a/exporter/datadogexporter/README.md +++ b/exporter/datadogexporter/README.md @@ -72,3 +72,7 @@ To get the service field correctly populated in your logs, you can specify servi [alpha]:https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [AWS]:https://aws-otel.github.io/docs/partners/datadog + +### How to add custom log source + +In order to add a custom source to your OTLP logs, set log attribute or resource attribute `datadog.log.source`. From f350c01951c09525660beb911fe5b9db9a5314dc Mon Sep 17 00:00:00 2001 From: mackjmr Date: Mon, 9 Sep 2024 13:29:25 +0200 Subject: [PATCH 5/6] address feedback --- exporter/datadogexporter/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/exporter/datadogexporter/README.md b/exporter/datadogexporter/README.md index 1dc08d9909bc..0d314f83f668 100644 --- a/exporter/datadogexporter/README.md +++ b/exporter/datadogexporter/README.md @@ -75,4 +75,14 @@ To get the service field correctly populated in your logs, you can specify servi ### How to add custom log source -In order to add a custom source to your OTLP logs, set log attribute or resource attribute `datadog.log.source`. +In order to add a custom source to your OTLP logs, set log attribute or resource attribute `datadog.log.source`. This feature requires `exporter.datadogexporter.UseLogsAgentExporter` feature flag to be enabled (now enabled by default). + +Example: +``` +processors: + transform/logs: + log_statements: + - context: resource + statements: + - set(attributes["datadog.log.source"], "otel") +``` From 5f5deeb990fbc36d5d1c097ed3441667280f124c Mon Sep 17 00:00:00 2001 From: mackjmr Date: Mon, 9 Sep 2024 15:04:59 +0200 Subject: [PATCH 6/6] remove doc for log attribute, only document resource attribute --- .chloggen/mackjmr_custom-log-src-support.yaml | 2 +- exporter/datadogexporter/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.chloggen/mackjmr_custom-log-src-support.yaml b/.chloggen/mackjmr_custom-log-src-support.yaml index 7fa1420ad688..888a50e30206 100644 --- a/.chloggen/mackjmr_custom-log-src-support.yaml +++ b/.chloggen/mackjmr_custom-log-src-support.yaml @@ -7,7 +7,7 @@ change_type: enhancement component: datadogexporter # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add support for setting a custom log source from resource attribute or log attribute `datadog.log.source` +note: Add support for setting a custom log source from resource attribute `datadog.log.source` # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. issues: [35051] diff --git a/exporter/datadogexporter/README.md b/exporter/datadogexporter/README.md index 0d314f83f668..bc9803f3bae3 100644 --- a/exporter/datadogexporter/README.md +++ b/exporter/datadogexporter/README.md @@ -75,7 +75,7 @@ To get the service field correctly populated in your logs, you can specify servi ### How to add custom log source -In order to add a custom source to your OTLP logs, set log attribute or resource attribute `datadog.log.source`. This feature requires `exporter.datadogexporter.UseLogsAgentExporter` feature flag to be enabled (now enabled by default). +In order to add a custom source to your OTLP logs, set resource attribute `datadog.log.source`. This feature requires `exporter.datadogexporter.UseLogsAgentExporter` feature flag to be enabled (now enabled by default). Example: ```