From 52ef475ae4925ad03198d83ea0ac3496ded0b21f Mon Sep 17 00:00:00 2001 From: Kangyi LI Date: Tue, 25 Nov 2025 14:46:27 +0100 Subject: [PATCH] update the datadog exporter to support the orchestrator explorer --- .chloggen/kangyi_add-orch-explorer.yaml | 27 +++ connector/datadogconnector/go.mod | 9 +- connector/datadogconnector/go.sum | 22 +-- exporter/datadogexporter/go.mod | 9 +- exporter/datadogexporter/go.sum | 22 +-- .../datadogexporter/integrationtest/go.mod | 7 +- .../datadogexporter/integrationtest/go.sum | 18 +- exporter/datadogexporter/logs_exporter.go | 9 +- internal/datadog/e2e/go.mod | 15 +- internal/datadog/e2e/go.sum | 30 ++-- pkg/datadog/config/config.go | 10 +- pkg/datadog/config/config_test.go | 160 +++++++++++------- pkg/datadog/config/orchestrator_explorer.go | 16 +- pkg/datadog/config/testdata/config.yaml | 4 + pkg/datadog/config/testdata/unmarshal.yaml | 10 ++ 15 files changed, 229 insertions(+), 139 deletions(-) create mode 100644 .chloggen/kangyi_add-orch-explorer.yaml diff --git a/.chloggen/kangyi_add-orch-explorer.yaml b/.chloggen/kangyi_add-orch-explorer.yaml new file mode 100644 index 0000000000000..6a0dc26826eda --- /dev/null +++ b/.chloggen/kangyi_add-orch-explorer.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. receiver/filelog) +component: exporter/datadog + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Update the Datadog exporter to support the Orchestrator Explorer by accepting receiver/k8sobjects logs and sending Kubernetes data to the Datadog endpoint. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [44523] + +# (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: [user] diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index 2a92ee3450b4a..bdf7f8b896e82 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.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/serializer/logscompression v0.73.0-rc.9 // indirect @@ -90,6 +90,7 @@ require ( github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/metrics v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9 // indirect + github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50 // indirect github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/proto v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.73.0-rc.9 // indirect @@ -256,7 +257,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.9 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/tinylib/msgp v1.4.0 // indirect + github.com/tinylib/msgp v1.5.0 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect github.com/twmb/murmur3 v1.1.8 // indirect @@ -344,9 +345,9 @@ require ( go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.45.0 // indirect - golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect + golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect golang.org/x/net v0.47.0 // indirect - golang.org/x/oauth2 v0.32.0 // indirect + golang.org/x/oauth2 v0.33.0 // indirect golang.org/x/sync v0.18.0 // indirect golang.org/x/sys v0.38.0 // indirect golang.org/x/term v0.37.0 // indirect diff --git a/connector/datadogconnector/go.sum b/connector/datadogconnector/go.sum index c80e160df92cc..95342132786d5 100644 --- a/connector/datadogconnector/go.sum +++ b/connector/datadogconnector/go.sum @@ -49,8 +49,8 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9 h1: github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9/go.mod h1:SgowqHieNFawvnQnj156zPAnpbXojoGohrNHb531fQk= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9 h1:KFcLjEHElxV8N2h/Wa4Oby8RFjRXLfuPWMRFb5bwYUE= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9/go.mod h1:XGaoENesuzOwI0SuyVfsaNYYU8CRKd2nIFgLlvPcrVY= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9 h1:u67nO+yZD9IQCO50+SS+6OKEIvfgKAWVZ1Or6ca4sxM= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9/go.mod h1:w4NQBcCJOeSO275JHWeQE9nqJoFY5/vX+m0Z8BCatV0= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e h1:QH+MpGNUW5e+/C7rThl3Py5YVu2Hn9bjv6tGeDesGb0= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e/go.mod h1:VDz2K0H9PPyVB8eKRm+LkW1OJQs4vyyefOnTieAeDh0= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9 h1:gv6jzxtPmi7odQVniYdxqg3d1qgNvorFbM5vIFwTdbE= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9/go.mod h1:SoqX1KKdmXqKUOTWmsDlNrcvGoAJfTDsoi3YnI2pBOU= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.73.0-rc.9 h1:r+wSnpq0t4f3JCZP/rroDnERP6pgS+UMNrq0/GNR7LA= @@ -135,6 +135,8 @@ github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-r github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-rc.9/go.mod h1:cR+tJ/bf8vMvlI5yvcb672WkKHkRW9sM8arcCJz9Z9k= github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9 h1:sH+8QkvZ+EZQF0Svo7cV4syOGlmJD1v6gmZyAsWCDYI= github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9/go.mod h1:zV2jDqipTYKx3QHPHcAB1rNbf7izaBiIArOUdyD/whM= +github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50 h1:dI1TE4KAczmhORUgHMP/1p0GH7GxXMTS2TvCo3A9gQc= +github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50/go.mod h1:Gcwx1rDexVebPwoirDcyQ04iWAyq9eA68u2UUW+wsKU= github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9 h1:Q8khANjwpUauO51aLvMl+RJcwt4nwvHVrcdOAei9L1A= github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9/go.mod h1:5amRpr2UTlLhCXvivJUeTYaTopAsvtaKITw3fqjILDE= github.com/DataDog/datadog-agent/pkg/proto v0.73.0-rc.9 h1:cbTpcJg3+RY+y8nCNjgFdZJSG2Uw8l5/bQDJF7DDtJk= @@ -552,8 +554,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/tinylib/msgp v1.4.0 h1:SYOeDRiydzOw9kSiwdYp9UcBgPFtLU2WDHaJXyHruf8= -github.com/tinylib/msgp v1.4.0/go.mod h1:cvjFkb4RiC8qSBOPMGPSzSAx47nAsfhLVTCZZNuHv5o= +github.com/tinylib/msgp v1.5.0 h1:GWnqAE54wmnlFazjq2+vgr736Akg58iiHImh+kPY2pc= +github.com/tinylib/msgp v1.5.0/go.mod h1:cvjFkb4RiC8qSBOPMGPSzSAx47nAsfhLVTCZZNuHv5o= github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= @@ -813,8 +815,8 @@ golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b h1:18qgiDvlvH7kk8Ioa8Ov+K6xCi0GMvmGfGW0sgd/SYA= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0= +golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -840,8 +842,8 @@ golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= -golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= +golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -919,8 +921,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= +golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/exporter/datadogexporter/go.mod b/exporter/datadogexporter/go.mod index f994e6f9ad0f2..b668410330fe4 100644 --- a/exporter/datadogexporter/go.mod +++ b/exporter/datadogexporter/go.mod @@ -8,7 +8,7 @@ require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.73.0-rc.9 github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9 github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9 github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.73.0-rc.9 github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.73.0-rc.9 @@ -131,6 +131,7 @@ require ( require ( github.com/DataDog/datadog-agent/comp/api/api/def v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/core/secrets/noop-impl v0.73.0-rc.9 // indirect + github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50 // indirect github.com/DataDog/go-tuf v1.1.1-0.5.2 // indirect github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee // indirect github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect @@ -243,7 +244,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.9 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/tinylib/msgp v1.4.0 // indirect + github.com/tinylib/msgp v1.5.0 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect github.com/twmb/murmur3 v1.1.8 // indirect @@ -284,9 +285,9 @@ require ( go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.45.0 // indirect - golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect + golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect golang.org/x/net v0.47.0 // indirect - golang.org/x/oauth2 v0.32.0 // indirect + golang.org/x/oauth2 v0.33.0 // indirect golang.org/x/sync v0.18.0 // indirect golang.org/x/sys v0.38.0 // indirect golang.org/x/term v0.37.0 // indirect diff --git a/exporter/datadogexporter/go.sum b/exporter/datadogexporter/go.sum index 61f798f8955b4..0ebe378bac570 100644 --- a/exporter/datadogexporter/go.sum +++ b/exporter/datadogexporter/go.sum @@ -49,8 +49,8 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9 h1: github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9/go.mod h1:SgowqHieNFawvnQnj156zPAnpbXojoGohrNHb531fQk= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9 h1:KFcLjEHElxV8N2h/Wa4Oby8RFjRXLfuPWMRFb5bwYUE= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9/go.mod h1:XGaoENesuzOwI0SuyVfsaNYYU8CRKd2nIFgLlvPcrVY= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9 h1:u67nO+yZD9IQCO50+SS+6OKEIvfgKAWVZ1Or6ca4sxM= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9/go.mod h1:w4NQBcCJOeSO275JHWeQE9nqJoFY5/vX+m0Z8BCatV0= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e h1:QH+MpGNUW5e+/C7rThl3Py5YVu2Hn9bjv6tGeDesGb0= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e/go.mod h1:VDz2K0H9PPyVB8eKRm+LkW1OJQs4vyyefOnTieAeDh0= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9 h1:gv6jzxtPmi7odQVniYdxqg3d1qgNvorFbM5vIFwTdbE= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9/go.mod h1:SoqX1KKdmXqKUOTWmsDlNrcvGoAJfTDsoi3YnI2pBOU= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.73.0-rc.9 h1:r+wSnpq0t4f3JCZP/rroDnERP6pgS+UMNrq0/GNR7LA= @@ -135,6 +135,8 @@ github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-r github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-rc.9/go.mod h1:cR+tJ/bf8vMvlI5yvcb672WkKHkRW9sM8arcCJz9Z9k= github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9 h1:sH+8QkvZ+EZQF0Svo7cV4syOGlmJD1v6gmZyAsWCDYI= github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9/go.mod h1:zV2jDqipTYKx3QHPHcAB1rNbf7izaBiIArOUdyD/whM= +github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50 h1:dI1TE4KAczmhORUgHMP/1p0GH7GxXMTS2TvCo3A9gQc= +github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50/go.mod h1:Gcwx1rDexVebPwoirDcyQ04iWAyq9eA68u2UUW+wsKU= github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9 h1:Q8khANjwpUauO51aLvMl+RJcwt4nwvHVrcdOAei9L1A= github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9/go.mod h1:5amRpr2UTlLhCXvivJUeTYaTopAsvtaKITw3fqjILDE= github.com/DataDog/datadog-agent/pkg/proto v0.73.0-rc.9 h1:cbTpcJg3+RY+y8nCNjgFdZJSG2Uw8l5/bQDJF7DDtJk= @@ -516,8 +518,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/tinylib/msgp v1.4.0 h1:SYOeDRiydzOw9kSiwdYp9UcBgPFtLU2WDHaJXyHruf8= -github.com/tinylib/msgp v1.4.0/go.mod h1:cvjFkb4RiC8qSBOPMGPSzSAx47nAsfhLVTCZZNuHv5o= +github.com/tinylib/msgp v1.5.0 h1:GWnqAE54wmnlFazjq2+vgr736Akg58iiHImh+kPY2pc= +github.com/tinylib/msgp v1.5.0/go.mod h1:cvjFkb4RiC8qSBOPMGPSzSAx47nAsfhLVTCZZNuHv5o= github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= @@ -667,8 +669,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b h1:18qgiDvlvH7kk8Ioa8Ov+K6xCi0GMvmGfGW0sgd/SYA= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0= +golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -681,8 +683,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= -golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= +golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -727,8 +729,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= +golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index fc15e4edd692e..5c9953bd6c15e 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -60,7 +60,7 @@ require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/serializer/logscompression v0.73.0-rc.9 // indirect @@ -100,6 +100,7 @@ require ( github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/metrics v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9 // indirect + github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50 // indirect github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/serializer v0.73.0-rc.9 // indirect @@ -355,9 +356,9 @@ require ( go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.45.0 // indirect - golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect + golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect golang.org/x/net v0.47.0 // indirect - golang.org/x/oauth2 v0.32.0 // indirect + golang.org/x/oauth2 v0.33.0 // indirect golang.org/x/sync v0.18.0 // indirect golang.org/x/sys v0.38.0 // indirect golang.org/x/term v0.37.0 // indirect diff --git a/exporter/datadogexporter/integrationtest/go.sum b/exporter/datadogexporter/integrationtest/go.sum index 4792140dc3316..7aee78d504d5a 100644 --- a/exporter/datadogexporter/integrationtest/go.sum +++ b/exporter/datadogexporter/integrationtest/go.sum @@ -53,8 +53,8 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9 h1: github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9/go.mod h1:SgowqHieNFawvnQnj156zPAnpbXojoGohrNHb531fQk= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9 h1:KFcLjEHElxV8N2h/Wa4Oby8RFjRXLfuPWMRFb5bwYUE= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9/go.mod h1:XGaoENesuzOwI0SuyVfsaNYYU8CRKd2nIFgLlvPcrVY= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9 h1:u67nO+yZD9IQCO50+SS+6OKEIvfgKAWVZ1Or6ca4sxM= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9/go.mod h1:w4NQBcCJOeSO275JHWeQE9nqJoFY5/vX+m0Z8BCatV0= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e h1:QH+MpGNUW5e+/C7rThl3Py5YVu2Hn9bjv6tGeDesGb0= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e/go.mod h1:VDz2K0H9PPyVB8eKRm+LkW1OJQs4vyyefOnTieAeDh0= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9 h1:gv6jzxtPmi7odQVniYdxqg3d1qgNvorFbM5vIFwTdbE= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9/go.mod h1:SoqX1KKdmXqKUOTWmsDlNrcvGoAJfTDsoi3YnI2pBOU= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.73.0-rc.9 h1:r+wSnpq0t4f3JCZP/rroDnERP6pgS+UMNrq0/GNR7LA= @@ -139,6 +139,8 @@ github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-r github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-rc.9/go.mod h1:cR+tJ/bf8vMvlI5yvcb672WkKHkRW9sM8arcCJz9Z9k= github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9 h1:sH+8QkvZ+EZQF0Svo7cV4syOGlmJD1v6gmZyAsWCDYI= github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9/go.mod h1:zV2jDqipTYKx3QHPHcAB1rNbf7izaBiIArOUdyD/whM= +github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50 h1:dI1TE4KAczmhORUgHMP/1p0GH7GxXMTS2TvCo3A9gQc= +github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50/go.mod h1:Gcwx1rDexVebPwoirDcyQ04iWAyq9eA68u2UUW+wsKU= github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9 h1:Q8khANjwpUauO51aLvMl+RJcwt4nwvHVrcdOAei9L1A= github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9/go.mod h1:5amRpr2UTlLhCXvivJUeTYaTopAsvtaKITw3fqjILDE= github.com/DataDog/datadog-agent/pkg/proto v0.73.0-rc.9 h1:cbTpcJg3+RY+y8nCNjgFdZJSG2Uw8l5/bQDJF7DDtJk= @@ -869,8 +871,8 @@ golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b h1:18qgiDvlvH7kk8Ioa8Ov+K6xCi0GMvmGfGW0sgd/SYA= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0= +golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -896,8 +898,8 @@ golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= -golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= +golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -975,8 +977,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= +golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/exporter/datadogexporter/logs_exporter.go b/exporter/datadogexporter/logs_exporter.go index 5165e6eab7a37..12124d62d7c3f 100644 --- a/exporter/datadogexporter/logs_exporter.go +++ b/exporter/datadogexporter/logs_exporter.go @@ -46,11 +46,18 @@ func newLogsAgentExporter( agentcomponents.WithLogsDefaults(), agentcomponents.WithProxy(cfg), ) + hostnameComponent := logs.NewHostnameService(sourceProvider) logsAgentConfig := &logsagentexporter.Config{ OtelSource: otelSource, LogSourceName: logSourceName, + OrchestratorConfig: logsagentexporter.OrchestratorConfig{ + Hostname: hostnameComponent, + Key: string(cfg.API.Key), + Site: cfg.API.Site, + Endpoint: cfg.OrchestratorExplorer.Endpoint, + Enabled: cfg.OrchestratorExplorer.Enabled, + }, } - hostnameComponent := logs.NewHostnameService(sourceProvider) logsAgent := logsagentpipelineimpl.NewLogsAgent(logsagentpipelineimpl.Dependencies{ Log: logComponent, Config: cfgComponent, diff --git a/internal/datadog/e2e/go.mod b/internal/datadog/e2e/go.mod index 8875d54d35145..f5cdabf4d781d 100644 --- a/internal/datadog/e2e/go.mod +++ b/internal/datadog/e2e/go.mod @@ -59,7 +59,7 @@ require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/comp/serializer/logscompression v0.73.0-rc.9 // indirect @@ -99,6 +99,7 @@ require ( github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/metrics v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9 // indirect + github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50 // indirect github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/proto v0.73.0-rc.9 // indirect github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.73.0-rc.9 // indirect @@ -285,7 +286,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mdlayher/socket v0.4.1 // indirect + github.com/mdlayher/socket v0.5.1 // indirect github.com/mdlayher/vsock v1.2.1 // indirect github.com/miekg/dns v1.1.68 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -363,7 +364,7 @@ require ( github.com/stackitcloud/stackit-sdk-go/core v0.17.3 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/tilinna/clock v1.1.0 // indirect - github.com/tinylib/msgp v1.4.0 // indirect + github.com/tinylib/msgp v1.5.0 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect github.com/twmb/murmur3 v1.1.8 // indirect @@ -470,16 +471,16 @@ require ( go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.45.0 // indirect - golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect - golang.org/x/mod v0.29.0 // indirect + golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect + golang.org/x/mod v0.30.0 // indirect golang.org/x/net v0.47.0 // indirect - golang.org/x/oauth2 v0.32.0 // indirect + golang.org/x/oauth2 v0.33.0 // indirect golang.org/x/sync v0.18.0 // indirect golang.org/x/sys v0.38.0 // indirect golang.org/x/term v0.37.0 // indirect golang.org/x/text v0.31.0 // indirect golang.org/x/time v0.14.0 // indirect - golang.org/x/tools v0.38.0 // indirect + golang.org/x/tools v0.39.0 // indirect gonum.org/v1/gonum v0.16.0 // indirect google.golang.org/api v0.250.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect diff --git a/internal/datadog/e2e/go.sum b/internal/datadog/e2e/go.sum index 593954d7d3a7f..416d90a8571dd 100644 --- a/internal/datadog/e2e/go.sum +++ b/internal/datadog/e2e/go.sum @@ -79,8 +79,8 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9 h1: github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.73.0-rc.9/go.mod h1:SgowqHieNFawvnQnj156zPAnpbXojoGohrNHb531fQk= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9 h1:KFcLjEHElxV8N2h/Wa4Oby8RFjRXLfuPWMRFb5bwYUE= github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.73.0-rc.9/go.mod h1:XGaoENesuzOwI0SuyVfsaNYYU8CRKd2nIFgLlvPcrVY= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9 h1:u67nO+yZD9IQCO50+SS+6OKEIvfgKAWVZ1Or6ca4sxM= -github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-rc.9/go.mod h1:w4NQBcCJOeSO275JHWeQE9nqJoFY5/vX+m0Z8BCatV0= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e h1:QH+MpGNUW5e+/C7rThl3Py5YVu2Hn9bjv6tGeDesGb0= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.73.0-devel.0.20251123155152-cc7b409e194e/go.mod h1:VDz2K0H9PPyVB8eKRm+LkW1OJQs4vyyefOnTieAeDh0= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9 h1:gv6jzxtPmi7odQVniYdxqg3d1qgNvorFbM5vIFwTdbE= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.73.0-rc.9/go.mod h1:SoqX1KKdmXqKUOTWmsDlNrcvGoAJfTDsoi3YnI2pBOU= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.73.0-rc.9 h1:r+wSnpq0t4f3JCZP/rroDnERP6pgS+UMNrq0/GNR7LA= @@ -165,6 +165,8 @@ github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-r github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/rum v0.73.0-rc.9/go.mod h1:cR+tJ/bf8vMvlI5yvcb672WkKHkRW9sM8arcCJz9Z9k= github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9 h1:sH+8QkvZ+EZQF0Svo7cV4syOGlmJD1v6gmZyAsWCDYI= github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.73.0-rc.9/go.mod h1:zV2jDqipTYKx3QHPHcAB1rNbf7izaBiIArOUdyD/whM= +github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50 h1:dI1TE4KAczmhORUgHMP/1p0GH7GxXMTS2TvCo3A9gQc= +github.com/DataDog/datadog-agent/pkg/orchestrator/util v0.0.0-20251120165911-0b75c97e8b50/go.mod h1:Gcwx1rDexVebPwoirDcyQ04iWAyq9eA68u2UUW+wsKU= github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9 h1:Q8khANjwpUauO51aLvMl+RJcwt4nwvHVrcdOAei9L1A= github.com/DataDog/datadog-agent/pkg/process/util/api v0.73.0-rc.9/go.mod h1:5amRpr2UTlLhCXvivJUeTYaTopAsvtaKITw3fqjILDE= github.com/DataDog/datadog-agent/pkg/proto v0.73.0-rc.9 h1:cbTpcJg3+RY+y8nCNjgFdZJSG2Uw8l5/bQDJF7DDtJk= @@ -686,8 +688,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= -github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= -github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= +github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos= +github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ= github.com/mdlayher/vsock v1.2.1 h1:pC1mTJTvjo1r9n9fbm7S1j04rCgCzhCOS5DY0zqHlnQ= github.com/mdlayher/vsock v1.2.1/go.mod h1:NRfCibel++DgeMD8z/hP+PPTjlNJsdPOmxcnENvE+SE= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -900,8 +902,8 @@ github.com/tidwall/wal v1.2.1 h1:xQvwnRF3e+xBC4NvFvl1mPGJHU0aH5zNzlUKnKGIImA= github.com/tidwall/wal v1.2.1/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= github.com/tilinna/clock v1.1.0 h1:6IQQQCo6KoBxVudv6gwtY8o4eDfhHo8ojA5dP0MfhSs= github.com/tilinna/clock v1.1.0/go.mod h1:ZsP7BcY7sEEz7ktc0IVy8Us6boDrK8VradlKRUGfOao= -github.com/tinylib/msgp v1.4.0 h1:SYOeDRiydzOw9kSiwdYp9UcBgPFtLU2WDHaJXyHruf8= -github.com/tinylib/msgp v1.4.0/go.mod h1:cvjFkb4RiC8qSBOPMGPSzSAx47nAsfhLVTCZZNuHv5o= +github.com/tinylib/msgp v1.5.0 h1:GWnqAE54wmnlFazjq2+vgr736Akg58iiHImh+kPY2pc= +github.com/tinylib/msgp v1.5.0/go.mod h1:cvjFkb4RiC8qSBOPMGPSzSAx47nAsfhLVTCZZNuHv5o= github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= @@ -1190,8 +1192,8 @@ golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b h1:18qgiDvlvH7kk8Ioa8Ov+K6xCi0GMvmGfGW0sgd/SYA= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0= +golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -1201,8 +1203,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= -golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= +golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk= +golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1223,8 +1225,8 @@ golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= -golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= +golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1321,8 +1323,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= +golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= golang.org/x/tools/godoc v0.1.0-deprecated h1:o+aZ1BOj6Hsx/GBdJO/s815sqftjSnrZZwyYTHODvtk= golang.org/x/tools/godoc v0.1.0-deprecated/go.mod h1:qM63CriJ961IHWmnWa9CjZnBndniPt4a3CK0PVB9bIg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/datadog/config/config.go b/pkg/datadog/config/config.go index 62c5d6f0d3b15..8d5a7ebc9db95 100644 --- a/pkg/datadog/config/config.go +++ b/pkg/datadog/config/config.go @@ -177,10 +177,6 @@ func (c *Config) Validate() error { return errors.New("reporter_period must be 5 minutes or higher") } - if err := c.OrchestratorExplorer.Validate(); err != nil { - return err - } - return nil } @@ -326,6 +322,9 @@ func (c *Config) Unmarshal(configMap *confmap.Conf) error { if !configMap.IsSet("logs::endpoint") { c.Logs.Endpoint = fmt.Sprintf("https://http-intake.logs.%s", c.API.Site) } + if !configMap.IsSet("orchestrator_explorer::endpoint") { + c.OrchestratorExplorer.Endpoint = fmt.Sprintf("https://orchestrator.%s/api/v2/orchmanif", c.API.Site) + } // Return an error if an endpoint is explicitly set to "" if c.Metrics.Endpoint == "" || c.Traces.Endpoint == "" || c.Logs.Endpoint == "" { @@ -411,6 +410,9 @@ func CreateDefaultConfig() component.Config { }, OrchestratorExplorer: OrchestratorExplorerConfig{ + TCPAddrConfig: confignet.TCPAddrConfig{ + Endpoint: "https://orchestrator.datadoghq.com/api/v2/orchmanif", + }, Enabled: false, }, diff --git a/pkg/datadog/config/config_test.go b/pkg/datadog/config/config_test.go index a48b042a3f9c9..37789f286ac40 100644 --- a/pkg/datadog/config/config_test.go +++ b/pkg/datadog/config/config_test.go @@ -201,18 +201,6 @@ func TestValidate(t *testing.T) { }, err: "reporter_period must be 5 minutes or higher", }, - { - name: "empty cluster_name when orchestrator_explorer is enabled", - cfg: &Config{ - API: APIConfig{Key: "abcdef0"}, - HostMetadata: HostMetadataConfig{Enabled: true, ReporterPeriod: 10 * time.Minute}, - OrchestratorExplorer: OrchestratorExplorerConfig{ - Enabled: true, - ClusterName: "", - }, - }, - err: "'cluster_name' is required when 'orchestrator_explorer' is enabled", - }, } for _, testInstance := range tests { t.Run(testInstance.name, func(t *testing.T) { @@ -544,6 +532,12 @@ func TestCreateDefaultConfig(t *testing.T) { }, HostnameDetectionTimeout: 25 * time.Second, OnlyMetadata: false, + OrchestratorExplorer: OrchestratorExplorerConfig{ + TCPAddrConfig: confignet.TCPAddrConfig{ + Endpoint: "https://orchestrator.datadoghq.com/api/v2/orchmanif", + }, + Enabled: false, + }, }, cfg, "failed to create default config") assert.NoError(t, componenttest.CheckConfigStruct(cfg)) @@ -620,6 +614,12 @@ func TestLoadConfig(t *testing.T) { }, HostnameDetectionTimeout: 25 * time.Second, OnlyMetadata: false, + OrchestratorExplorer: OrchestratorExplorerConfig{ + TCPAddrConfig: confignet.TCPAddrConfig{ + Endpoint: "https://orchestrator.datadoghq.com/api/v2/orchmanif", + }, + Enabled: false, + }, }, }, { @@ -688,6 +688,12 @@ func TestLoadConfig(t *testing.T) { ReporterPeriod: 30 * time.Minute, }, HostnameDetectionTimeout: 25 * time.Second, + OrchestratorExplorer: OrchestratorExplorerConfig{ + TCPAddrConfig: confignet.TCPAddrConfig{ + Endpoint: "https://orchestrator.datadoghq.eu/api/v2/orchmanif", + }, + Enabled: false, + }, }, }, { @@ -754,6 +760,12 @@ func TestLoadConfig(t *testing.T) { ReporterPeriod: 30 * time.Minute, }, HostnameDetectionTimeout: 25 * time.Second, + OrchestratorExplorer: OrchestratorExplorerConfig{ + TCPAddrConfig: confignet.TCPAddrConfig{ + Endpoint: "https://orchestrator.datadoghq.test/api/v2/orchmanif", + }, + Enabled: false, + }, }, }, { @@ -815,6 +827,12 @@ func TestLoadConfig(t *testing.T) { }, HostnameDetectionTimeout: 25 * time.Second, OnlyMetadata: false, + OrchestratorExplorer: OrchestratorExplorerConfig{ + TCPAddrConfig: confignet.TCPAddrConfig{ + Endpoint: "https://orchestrator.datadoghq.com/api/v2/orchmanif", + }, + Enabled: false, + }, }, }, } @@ -835,75 +853,93 @@ func TestLoadConfig(t *testing.T) { func TestOverrideEndpoints(t *testing.T) { tests := []struct { - componentID string - expectedSite string - expectedMetricsEndpoint string - expectedTracesEndpoint string - expectedLogsEndpoint string + componentID string + expectedSite string + expectedMetricsEndpoint string + expectedTracesEndpoint string + expectedLogsEndpoint string + expectedOrchestratorExplorerEndpoint string }{ { - componentID: "nositeandnoendpoints", - expectedSite: "datadoghq.com", - expectedMetricsEndpoint: "https://api.datadoghq.com", - expectedTracesEndpoint: "https://trace.agent.datadoghq.com", - expectedLogsEndpoint: "https://http-intake.logs.datadoghq.com", + componentID: "nositeandnoendpoints", + expectedSite: "datadoghq.com", + expectedMetricsEndpoint: "https://api.datadoghq.com", + expectedTracesEndpoint: "https://trace.agent.datadoghq.com", + expectedLogsEndpoint: "https://http-intake.logs.datadoghq.com", + expectedOrchestratorExplorerEndpoint: "https://orchestrator.datadoghq.com/api/v2/orchmanif", }, { - componentID: "nositeandmetricsendpoint", - expectedSite: "datadoghq.com", - expectedMetricsEndpoint: "metricsendpoint:1234", - expectedTracesEndpoint: "https://trace.agent.datadoghq.com", - expectedLogsEndpoint: "https://http-intake.logs.datadoghq.com", + componentID: "nositeandmetricsendpoint", + expectedSite: "datadoghq.com", + expectedMetricsEndpoint: "metricsendpoint:1234", + expectedTracesEndpoint: "https://trace.agent.datadoghq.com", + expectedLogsEndpoint: "https://http-intake.logs.datadoghq.com", + expectedOrchestratorExplorerEndpoint: "https://orchestrator.datadoghq.com/api/v2/orchmanif", }, { - componentID: "nositeandtracesendpoint", - expectedSite: "datadoghq.com", - expectedMetricsEndpoint: "https://api.datadoghq.com", - expectedTracesEndpoint: "tracesendpoint:1234", - expectedLogsEndpoint: "https://http-intake.logs.datadoghq.com", + componentID: "nositeandtracesendpoint", + expectedSite: "datadoghq.com", + expectedMetricsEndpoint: "https://api.datadoghq.com", + expectedTracesEndpoint: "tracesendpoint:1234", + expectedLogsEndpoint: "https://http-intake.logs.datadoghq.com", + expectedOrchestratorExplorerEndpoint: "https://orchestrator.datadoghq.com/api/v2/orchmanif", }, { - componentID: "nositeandlogsendpoint", - expectedSite: "datadoghq.com", - expectedMetricsEndpoint: "https://api.datadoghq.com", - expectedTracesEndpoint: "https://trace.agent.datadoghq.com", - expectedLogsEndpoint: "logsendpoint:1234", + componentID: "nositeandlogsendpoint", + expectedSite: "datadoghq.com", + expectedMetricsEndpoint: "https://api.datadoghq.com", + expectedTracesEndpoint: "https://trace.agent.datadoghq.com", + expectedLogsEndpoint: "logsendpoint:1234", + expectedOrchestratorExplorerEndpoint: "https://orchestrator.datadoghq.com/api/v2/orchmanif", }, { - componentID: "nositeandallendpoints", - expectedSite: "datadoghq.com", - expectedMetricsEndpoint: "metricsendpoint:1234", - expectedTracesEndpoint: "tracesendpoint:1234", - expectedLogsEndpoint: "logsendpoint:1234", + componentID: "nositeandallendpoints", + expectedSite: "datadoghq.com", + expectedMetricsEndpoint: "metricsendpoint:1234", + expectedTracesEndpoint: "tracesendpoint:1234", + expectedLogsEndpoint: "logsendpoint:1234", + expectedOrchestratorExplorerEndpoint: "orchestratorexplorerendpoint:1234", }, { - componentID: "siteandnoendpoints", - expectedSite: "datadoghq.eu", - expectedMetricsEndpoint: "https://api.datadoghq.eu", - expectedTracesEndpoint: "https://trace.agent.datadoghq.eu", - expectedLogsEndpoint: "https://http-intake.logs.datadoghq.eu", + componentID: "siteandnoendpoints", + expectedSite: "datadoghq.eu", + expectedMetricsEndpoint: "https://api.datadoghq.eu", + expectedTracesEndpoint: "https://trace.agent.datadoghq.eu", + expectedLogsEndpoint: "https://http-intake.logs.datadoghq.eu", + expectedOrchestratorExplorerEndpoint: "https://orchestrator.datadoghq.eu/api/v2/orchmanif", + }, + { + componentID: "siteandmetricsendpoint", + expectedSite: "datadoghq.eu", + expectedMetricsEndpoint: "metricsendpoint:1234", + expectedTracesEndpoint: "https://trace.agent.datadoghq.eu", + expectedLogsEndpoint: "https://http-intake.logs.datadoghq.eu", + expectedOrchestratorExplorerEndpoint: "https://orchestrator.datadoghq.eu/api/v2/orchmanif", }, { - componentID: "siteandmetricsendpoint", - expectedSite: "datadoghq.eu", - expectedMetricsEndpoint: "metricsendpoint:1234", - expectedTracesEndpoint: "https://trace.agent.datadoghq.eu", - expectedLogsEndpoint: "https://http-intake.logs.datadoghq.eu", + componentID: "siteandtracesendpoint", + expectedSite: "datadoghq.eu", + expectedMetricsEndpoint: "https://api.datadoghq.eu", + expectedTracesEndpoint: "tracesendpoint:1234", + expectedLogsEndpoint: "https://http-intake.logs.datadoghq.eu", + expectedOrchestratorExplorerEndpoint: "https://orchestrator.datadoghq.eu/api/v2/orchmanif", }, { - componentID: "siteandtracesendpoint", - expectedSite: "datadoghq.eu", - expectedMetricsEndpoint: "https://api.datadoghq.eu", - expectedTracesEndpoint: "tracesendpoint:1234", - expectedLogsEndpoint: "https://http-intake.logs.datadoghq.eu", + componentID: "siteandallendpoints", + expectedSite: "datadoghq.eu", + expectedMetricsEndpoint: "metricsendpoint:1234", + expectedTracesEndpoint: "tracesendpoint:1234", + expectedLogsEndpoint: "logsendpoint:1234", + expectedOrchestratorExplorerEndpoint: "orchestratorexplorerendpoint:1234", }, { - componentID: "siteandallendpoints", - expectedSite: "datadoghq.eu", - expectedMetricsEndpoint: "metricsendpoint:1234", - expectedTracesEndpoint: "tracesendpoint:1234", - expectedLogsEndpoint: "logsendpoint:1234", + componentID: "siteandorchestratorexplorerendpoint", + expectedSite: "datadoghq.eu", + expectedMetricsEndpoint: "https://api.datadoghq.eu", + expectedTracesEndpoint: "https://trace.agent.datadoghq.eu", + expectedLogsEndpoint: "https://http-intake.logs.datadoghq.eu", + expectedOrchestratorExplorerEndpoint: "orchestratorexplorerendpoint:1234", }, } diff --git a/pkg/datadog/config/orchestrator_explorer.go b/pkg/datadog/config/orchestrator_explorer.go index fbf57de3e063a..2a0913a57571d 100644 --- a/pkg/datadog/config/orchestrator_explorer.go +++ b/pkg/datadog/config/orchestrator_explorer.go @@ -3,21 +3,13 @@ package config // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog/config" -import "errors" +import "go.opentelemetry.io/collector/config/confignet" // OrchestratorExplorerConfig defines configuration for the Datadog orchestrator explorer. type OrchestratorExplorerConfig struct { + // TCPAddr.Endpoint is the host of the Datadog orchestrator intake server to send data to. + // If unset, the value is obtained from the Site. + confignet.TCPAddrConfig `mapstructure:",squash"` // Enabled enables the orchestrator explorer. Enabled bool `mapstructure:"enabled"` - - // ClusterName defines the kubernetes cluster name. - ClusterName string `mapstructure:"cluster_name"` -} - -// Validate the configuration for errors. -func (c *OrchestratorExplorerConfig) Validate() error { - if c.Enabled && c.ClusterName == "" { - return errors.New("'cluster_name' is required when 'orchestrator_explorer' is enabled") - } - return nil } diff --git a/pkg/datadog/config/testdata/config.yaml b/pkg/datadog/config/testdata/config.yaml index 0dbfc0a4782af..1da7612bb81a0 100644 --- a/pkg/datadog/config/testdata/config.yaml +++ b/pkg/datadog/config/testdata/config.yaml @@ -34,6 +34,10 @@ datadog/api2: logs: endpoint: https://http-intake.logs.datadoghq.test + orchestrator_explorer: + endpoint: https://orchestrator.datadoghq.test/api/v2/orchmanif + enabled: false + datadog/default: api: key: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/pkg/datadog/config/testdata/unmarshal.yaml b/pkg/datadog/config/testdata/unmarshal.yaml index b3c5b76036d4b..304e40ae77408 100644 --- a/pkg/datadog/config/testdata/unmarshal.yaml +++ b/pkg/datadog/config/testdata/unmarshal.yaml @@ -19,6 +19,8 @@ datadog/nositeandallendpoints: endpoint: "tracesendpoint:1234" logs: endpoint: "logsendpoint:1234" + orchestrator_explorer: + endpoint: "orchestratorexplorerendpoint:1234" datadog/siteandnoendpoints: api: @@ -51,3 +53,11 @@ datadog/siteandallendpoints: endpoint: "tracesendpoint:1234" logs: endpoint: "logsendpoint:1234" + orchestrator_explorer: + endpoint: "orchestratorexplorerendpoint:1234" + +datadog/siteandorchestratorexplorerendpoint: + api: + site: datadoghq.eu + orchestrator_explorer: + endpoint: "orchestratorexplorerendpoint:1234"