diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1569d87fd96ef..042dc565a8f9f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -493,7 +493,6 @@ /pkg/process/metadata/parser/*windows* @DataDog/universal-service-monitoring @DataDog/processes @DataDog/Networks @DataDog/windows-kernel-integrations /pkg/process/monitor/ @DataDog/universal-service-monitoring /pkg/process/net/ @DataDog/universal-service-monitoring @DataDog/Networks -/pkg/process/net/common_windows.go @DataDog/windows-agent /pkg/proto/datadog/remoteconfig/ @DataDog/remote-config /pkg/proto/pbgo/ # do not notify anyone /pkg/proto/pbgo/trace @DataDog/agent-apm diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4ce361a8a19f1..d6886960d2396 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -45,7 +45,7 @@ jobs: go-version-file: ".go-version" - name: Initialize CodeQL - uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/init@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3.27.7 with: languages: ${{ matrix.language }} config: | @@ -67,4 +67,4 @@ jobs: invoke agent.build --build-exclude=systemd - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/analyze@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3.27.7 diff --git a/.github/workflows/collector-generate-and-update.yml b/.github/workflows/collector-generate-and-update.yml index 8852a0ca424c0..275f6fbbcf410 100644 --- a/.github/workflows/collector-generate-and-update.yml +++ b/.github/workflows/collector-generate-and-update.yml @@ -14,16 +14,22 @@ jobs: - name: Checkout repository uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: Read tool versions + id: tool-versions + run: | + echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV + echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV + - name: Set up Python uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: - python-version: 3.12 + python-version: ${{ env.PYTHON_VERSION }} cache: 'pip' - name: Set up Go uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: - go-version: '1.22.8' + go-version: ${{ env.GO_VERSION }} - name: Install Dependencies run: | @@ -34,6 +40,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + inv -e install-tools inv -e collector.update inv -e collector.generate inv -e generate-licenses diff --git a/.github/workflows/create_rc_pr.yml b/.github/workflows/create_rc_pr.yml index 5539dc44532b1..623b6e9dee395 100644 --- a/.github/workflows/create_rc_pr.yml +++ b/.github/workflows/create_rc_pr.yml @@ -59,7 +59,7 @@ jobs: value: ${{fromJSON(needs.find_release_branches.outputs.branches)}} fail-fast: false steps: - - name: Checkout release branch + - name: Checkout the main branch uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: persist-credentials: true diff --git a/.github/workflows/serverless-integration.yml b/.github/workflows/serverless-integration.yml index 7414d78ac65b3..de78371e895e1 100644 --- a/.github/workflows/serverless-integration.yml +++ b/.github/workflows/serverless-integration.yml @@ -70,7 +70,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.SERVERLESS_AWS_SECRET_ACCESS_KEY }} GOWORK: off with: - timeout_minutes: 60 + timeout_minutes: 120 max_attempts: 2 command: | RAWLOGS_DIR="${{ steps.rawlogs.outputs.dir }}/${{ matrix.architecture }}" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67afb78dc55d8..38a0cde349fc8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -282,6 +282,9 @@ variables: .if_main_branch: &if_main_branch if: $CI_COMMIT_BRANCH == "main" +.if_not_main_branch: &if_not_main_branch + if: $CI_COMMIT_BRANCH != "main" + .if_release_branch: &if_release_branch if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/ @@ -628,6 +631,10 @@ workflow: variables: FAST_TESTS: "true" +.only_main: + - <<: *if_not_main_branch + when: never + .except_main_or_release_branch: - <<: *if_main_branch when: never diff --git a/.gitlab/JOBOWNERS b/.gitlab/JOBOWNERS index 361807d382218..e03f28a2d537d 100644 --- a/.gitlab/JOBOWNERS +++ b/.gitlab/JOBOWNERS @@ -114,9 +114,9 @@ deploy_packages* @DataDog/agent-delivery deploy_staging* @DataDog/agent-delivery publish_winget* @DataDog/windows-agent powershell_script_deploy @DataDog/windows-agent -windows_bootstrapper_deploy @DataDog/windows-agent +windows_bootstrapper_deploy @DataDog/windows-agent qa_*_oci @DataDog/agent-delivery -qa_installer_script @DataDog/agent-delivery +qa_installer_script* @DataDog/agent-delivery # Deploy containers deploy_containers* @Datadog/agent-delivery diff --git a/.gitlab/common/test_infra_version.yml b/.gitlab/common/test_infra_version.yml index 7844ff82e9ee3..7d435a4bc3a4b 100644 --- a/.gitlab/common/test_infra_version.yml +++ b/.gitlab/common/test_infra_version.yml @@ -4,4 +4,4 @@ variables: # and check the job creating the image to make sure you have the right SHA prefix TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX: "" # Make sure to update test-infra-definitions version in go.mod as well - TEST_INFRA_DEFINITIONS_BUILDIMAGES: 1f340fd450e3 + TEST_INFRA_DEFINITIONS_BUILDIMAGES: 9c7c5005ca28 diff --git a/.gitlab/e2e_install_packages/include.yml b/.gitlab/e2e_install_packages/include.yml index d710d975dc41a..cf50d55e12238 100644 --- a/.gitlab/e2e_install_packages/include.yml +++ b/.gitlab/e2e_install_packages/include.yml @@ -9,3 +9,4 @@ include: - .gitlab/e2e_install_packages/centos.yml - .gitlab/e2e_install_packages/suse.yml - .gitlab/e2e_install_packages/windows.yml + - .gitlab/e2e_install_packages/installer.yml diff --git a/.gitlab/e2e_install_packages/installer.yml b/.gitlab/e2e_install_packages/installer.yml new file mode 100644 index 0000000000000..da1cb2536b626 --- /dev/null +++ b/.gitlab/e2e_install_packages/installer.yml @@ -0,0 +1,15 @@ +qa_installer_script_main: + image: registry.ddbuild.io/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES + stage: e2e_install_packages + tags: ["arch:amd64"] + rules: + - !reference [.only_main] # Disable non-main branch. Must be first. + - !reference [.on_installer_or_e2e_changes] + - !reference [.manual] + needs: + - new-e2e-installer-script + - installer-install-scripts + before_script: + - ls $OMNIBUS_PACKAGE_DIR + script: + - $S3_CP_CMD --recursive --exclude "*" --include "install-*.sh" "$OMNIBUS_PACKAGE_DIR" "s3://${INSTALLER_TESTING_S3_BUCKET}/scripts/" diff --git a/.golangci.yml b/.golangci.yml index 320c25ce206a7..ece414c77fc1b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,8 +18,6 @@ issues: exclude: - "Error return value of `io.WriteString` is not checked" # 'errcheck' errors in tools/dep_tree_resolver/go_deps.go - "Error return value of `pem.Encode` is not checked" # 'errcheck' errors in test/integration/utils/certificates.go - - "Error return value of `c.logErrorNotImplemented` is not checked" # 'errcheck' errors in pkg/config/nodetreemodel/config.go - - "Error return value of `n.logErrorNotImplemented` is not checked" # 'errcheck' errors in pkg/config/nodetreemodel/config.go - "exported: exported const Exec should have comment \\(or a comment on this block\\) or be unexported" # 'revive' errors in pkg/process/events/model/model_common.go - "exported: exported const APIName should have comment \\(or a comment on this block\\) or be unexported" # 'revive' errors in pkg/serverless/trace/inferredspan/constants.go - "unnecessary conversion" # 'unconvert' errors in test/integration/utils/certificates_test.go diff --git a/Dockerfiles/agent/windows/amd64/Dockerfile b/Dockerfiles/agent/windows/amd64/Dockerfile index 72c7060810838..d99782f40167f 100755 --- a/Dockerfiles/agent/windows/amd64/Dockerfile +++ b/Dockerfiles/agent/windows/amd64/Dockerfile @@ -7,7 +7,8 @@ ARG WITH_JMX="false" ARG VARIANT="unknown" ARG INSTALL_INFO="unknown" ARG GENERAL_ARTIFACTS_CACHE_BUCKET_URL -ARG WITH_FIPS="false" +# Should be empty for non-FIPS builds +ARG WITH_FIPS LABEL maintainer "Datadog " @@ -23,6 +24,7 @@ RUN . ./install.ps1 COPY bouncycastle-fips /fips-build COPY install-fips.ps1 ./ RUN . ./install-fips.ps1 +ENV JAVA_TOOL_OPTIONS="${WITH_FIPS:+--module-path=\'c:\\program files\\datadog\\bouncycastle fips\' -Djava.security.properties==\'c:\\program files\\datadog\\bouncycastle fips\\java.security\' -Dpolicy.url.2=\'file:c:\\program files\\datadog\\bouncycastle fips\\bc-fips.policy\'}" EXPOSE 8125/udp 8126/tcp diff --git a/cmd/installer-downloader/main.go b/cmd/installer-downloader/main.go index 45c628dc13069..5ddadc54c0d60 100644 --- a/cmd/installer-downloader/main.go +++ b/cmd/installer-downloader/main.go @@ -72,6 +72,7 @@ func runDownloader(ctx context.Context, env *env.Env, version string, flavor str return fmt.Errorf("failed to download installer: %w", err) } cmd := exec.CommandContext(ctx, filepath.Join(tmpDir, installerBinPath), "setup", "--flavor", flavor) + cmd.Dir = tmpDir cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr cmd.Env = append(os.Environ(), telemetry.EnvFromContext(ctx)...) @@ -92,6 +93,10 @@ func downloadInstaller(ctx context.Context, env *env.Env, version string, tmpDir if downloadedPackage.Name != installerPackage { return fmt.Errorf("unexpected package name: %s, expected %s", downloadedPackage.Name, installerPackage) } + err = downloadedPackage.WriteOCILayout(tmpDir) + if err != nil { + return fmt.Errorf("failed to write OCI layout: %w", err) + } err = downloadedPackage.ExtractLayers(oci.DatadogPackageLayerMediaType, tmpDir) if err != nil { return fmt.Errorf("failed to extract layers: %w", err) diff --git a/cmd/security-agent/subcommands/compliance/command.go b/cmd/security-agent/subcommands/compliance/command.go index d38285ee8d2b3..c6614a89232f7 100644 --- a/cmd/security-agent/subcommands/compliance/command.go +++ b/cmd/security-agent/subcommands/compliance/command.go @@ -14,7 +14,7 @@ import ( "path/filepath" "strings" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/spf13/cobra" "go.uber.org/fx" diff --git a/comp/agent/autoexit/autoexitimpl/manager.go b/comp/agent/autoexit/autoexitimpl/manager.go index db71ad7c4e042..44089dd4538d0 100644 --- a/comp/agent/autoexit/autoexitimpl/manager.go +++ b/comp/agent/autoexit/autoexitimpl/manager.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" ) const ( diff --git a/comp/api/authtoken/go.mod b/comp/api/authtoken/go.mod index 0d71335ec37a3..6bf63f57e855b 100644 --- a/comp/api/authtoken/go.mod +++ b/comp/api/authtoken/go.mod @@ -76,10 +76,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -93,8 +94,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/api/authtoken/go.sum b/comp/api/authtoken/go.sum index 1441562d69bde..e3973187c6caa 100644 --- a/comp/api/authtoken/go.sum +++ b/comp/api/authtoken/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -39,6 +39,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -169,12 +171,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/core/config/go.mod b/comp/core/config/go.mod index f7a43ae0beee2..42ae3495ec40c 100644 --- a/comp/core/config/go.mod +++ b/comp/core/config/go.mod @@ -43,7 +43,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 - github.com/DataDog/viper v1.13.5 + github.com/DataDog/viper v1.14.0 github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.23.0 ) @@ -71,6 +71,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -89,8 +90,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/core/config/go.sum b/comp/core/config/go.sum index 12326d3e1f9b6..def69bbe0b7b4 100644 --- a/comp/core/config/go.sum +++ b/comp/core/config/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -40,6 +40,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -172,12 +174,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/core/log/impl-trace/go.mod b/comp/core/log/impl-trace/go.mod index 5784f2a4cb400..1b107db1db8ee 100644 --- a/comp/core/log/impl-trace/go.mod +++ b/comp/core/log/impl-trace/go.mod @@ -77,9 +77,10 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -93,8 +94,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/core/log/impl-trace/go.sum b/comp/core/log/impl-trace/go.sum index 1441562d69bde..e3973187c6caa 100644 --- a/comp/core/log/impl-trace/go.sum +++ b/comp/core/log/impl-trace/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -39,6 +39,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -169,12 +171,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/core/log/impl/go.mod b/comp/core/log/impl/go.mod index ea5f5ddb29885..e6db1f6b650ff 100644 --- a/comp/core/log/impl/go.mod +++ b/comp/core/log/impl/go.mod @@ -66,10 +66,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -83,8 +84,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/core/log/impl/go.sum b/comp/core/log/impl/go.sum index 1441562d69bde..e3973187c6caa 100644 --- a/comp/core/log/impl/go.sum +++ b/comp/core/log/impl/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -39,6 +39,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -169,12 +171,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/core/log/mock/go.mod b/comp/core/log/mock/go.mod index 6bf266c22d51d..9f9b990745843 100644 --- a/comp/core/log/mock/go.mod +++ b/comp/core/log/mock/go.mod @@ -41,7 +41,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect diff --git a/comp/core/log/mock/go.sum b/comp/core/log/mock/go.sum index 1c7b17d164a5d..be954babd5c73 100644 --- a/comp/core/log/mock/go.sum +++ b/comp/core/log/mock/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -34,6 +34,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -149,10 +151,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/core/status/statusimpl/go.mod b/comp/core/status/statusimpl/go.mod index cfb7ac9182260..78738479544c0 100644 --- a/comp/core/status/statusimpl/go.mod +++ b/comp/core/status/statusimpl/go.mod @@ -78,11 +78,12 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -99,8 +100,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/core/status/statusimpl/go.sum b/comp/core/status/statusimpl/go.sum index 358c24ff26324..650216cc0ce50 100644 --- a/comp/core/status/statusimpl/go.sum +++ b/comp/core/status/statusimpl/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -41,6 +41,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -180,12 +182,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/dogstatsd/listeners/ratelimit/host_memory_usage.go b/comp/dogstatsd/listeners/ratelimit/host_memory_usage.go index de42845d803f2..a70a1331b31aa 100644 --- a/comp/dogstatsd/listeners/ratelimit/host_memory_usage.go +++ b/comp/dogstatsd/listeners/ratelimit/host_memory_usage.go @@ -6,7 +6,7 @@ package ratelimit import ( - "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v4/mem" ) var _ memoryUsage = (*hostMemoryUsage)(nil) diff --git a/comp/forwarder/defaultforwarder/go.mod b/comp/forwarder/defaultforwarder/go.mod index b3f2578ab6a84..05d96eab4fbcf 100644 --- a/comp/forwarder/defaultforwarder/go.mod +++ b/comp/forwarder/defaultforwarder/go.mod @@ -100,13 +100,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -131,8 +132,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/forwarder/defaultforwarder/go.sum b/comp/forwarder/defaultforwarder/go.sum index 9c26c44f1cda8..e668380b7ef00 100644 --- a/comp/forwarder/defaultforwarder/go.sum +++ b/comp/forwarder/defaultforwarder/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -40,6 +40,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -190,12 +192,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/forwarder/orchestrator/orchestratorinterface/go.mod b/comp/forwarder/orchestrator/orchestratorinterface/go.mod index 501885a0c7b7b..cb7b6044aeca0 100644 --- a/comp/forwarder/orchestrator/orchestratorinterface/go.mod +++ b/comp/forwarder/orchestrator/orchestratorinterface/go.mod @@ -102,13 +102,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -135,8 +136,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/forwarder/orchestrator/orchestratorinterface/go.sum b/comp/forwarder/orchestrator/orchestratorinterface/go.sum index debd6cceb8b31..49efb0a3efaf4 100644 --- a/comp/forwarder/orchestrator/orchestratorinterface/go.sum +++ b/comp/forwarder/orchestrator/orchestratorinterface/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/cast v1.8.0 h1:uooY8bMzq+cjgiNP1VTquCWve5emgk8fRspZojJwQa8= github.com/DataDog/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -43,6 +43,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -195,12 +197,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/logs/agent/config/go.mod b/comp/logs/agent/config/go.mod index da4be1701769d..c8360536b53c1 100644 --- a/comp/logs/agent/config/go.mod +++ b/comp/logs/agent/config/go.mod @@ -45,7 +45,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 - github.com/DataDog/viper v1.13.5 + github.com/DataDog/viper v1.14.0 github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.23.0 ) @@ -72,6 +72,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -85,8 +86,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/logs/agent/config/go.sum b/comp/logs/agent/config/go.sum index 1441562d69bde..e3973187c6caa 100644 --- a/comp/logs/agent/config/go.sum +++ b/comp/logs/agent/config/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -39,6 +39,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -169,12 +171,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/metadata/host/hostimpl/utils/host_nix.go b/comp/metadata/host/hostimpl/utils/host_nix.go index c78fc6098aa84..637b15c100ae8 100644 --- a/comp/metadata/host/hostimpl/utils/host_nix.go +++ b/comp/metadata/host/hostimpl/utils/host_nix.go @@ -10,8 +10,8 @@ package utils import ( "runtime" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/host" "github.com/DataDog/datadog-agent/pkg/collector/python" "github.com/DataDog/datadog-agent/pkg/util/cache" diff --git a/comp/metadata/host/hostimpl/utils/host_nix_test.go b/comp/metadata/host/hostimpl/utils/host_nix_test.go index 4eeb421827a75..ac5067f53e219 100644 --- a/comp/metadata/host/hostimpl/utils/host_nix_test.go +++ b/comp/metadata/host/hostimpl/utils/host_nix_test.go @@ -11,8 +11,8 @@ import ( "runtime" "testing" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/host" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/comp/otelcol/converter/impl/go.mod b/comp/otelcol/converter/impl/go.mod index b13dbe2c343f9..8b903df1c03a1 100644 --- a/comp/otelcol/converter/impl/go.mod +++ b/comp/otelcol/converter/impl/go.mod @@ -77,10 +77,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect @@ -100,8 +101,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/otelcol/converter/impl/go.sum b/comp/otelcol/converter/impl/go.sum index dd15ede05c8be..f3a0f24d8dbe0 100644 --- a/comp/otelcol/converter/impl/go.sum +++ b/comp/otelcol/converter/impl/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -39,6 +39,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -181,12 +183,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/otelcol/ddflareextension/impl/go.mod b/comp/otelcol/ddflareextension/impl/go.mod index dd9308fb62aa6..aff23ccf9501f 100644 --- a/comp/otelcol/ddflareextension/impl/go.mod +++ b/comp/otelcol/ddflareextension/impl/go.mod @@ -273,7 +273,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -429,9 +429,7 @@ require ( github.com/rs/cors v1.11.1 // indirect github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 // indirect github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect github.com/shirou/gopsutil/v4 v4.24.11 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/otelcol/ddflareextension/impl/go.sum b/comp/otelcol/ddflareextension/impl/go.sum index 7dd61c4dad8ad..be1b5d78f453d 100644 --- a/comp/otelcol/ddflareextension/impl/go.sum +++ b/comp/otelcol/ddflareextension/impl/go.sum @@ -92,8 +92,8 @@ github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdus github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= diff --git a/comp/otelcol/logsagentpipeline/go.mod b/comp/otelcol/logsagentpipeline/go.mod index 4966bc8e9fbad..603e8abcce366 100644 --- a/comp/otelcol/logsagentpipeline/go.mod +++ b/comp/otelcol/logsagentpipeline/go.mod @@ -107,13 +107,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -136,8 +137,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/otelcol/logsagentpipeline/go.sum b/comp/otelcol/logsagentpipeline/go.sum index 2046340fbb070..0816ff6b27cb5 100644 --- a/comp/otelcol/logsagentpipeline/go.sum +++ b/comp/otelcol/logsagentpipeline/go.sum @@ -4,8 +4,8 @@ github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytlju github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 h1:RoH7VLzTnxHEugRPIgnGlxwDFszFGI7b3WZZUtWuPRM= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42/go.mod h1:TX7CTOQ3LbQjfAi4SwqUoR5gY1zfUk7VRBDTuArjaDc= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -44,6 +44,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -186,12 +188,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod index 245d0eb4b48b0..a21412d390c1b 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod @@ -122,13 +122,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -151,8 +152,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum index 2046340fbb070..0816ff6b27cb5 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum @@ -4,8 +4,8 @@ github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytlju github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 h1:RoH7VLzTnxHEugRPIgnGlxwDFszFGI7b3WZZUtWuPRM= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42/go.mod h1:TX7CTOQ3LbQjfAi4SwqUoR5gY1zfUk7VRBDTuArjaDc= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -44,6 +44,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -186,12 +188,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod index 0cc920d4b5d13..5f275b6f0bb73 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod @@ -205,7 +205,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -220,6 +220,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect @@ -276,8 +277,7 @@ require ( github.com/richardartoul/molecule v1.0.1-0.20240531184615-7ca0df43c0b3 // indirect github.com/rs/cors v1.11.1 // indirect github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum b/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum index 0b1fe883a8e59..fc769d52cb6f5 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum @@ -28,8 +28,8 @@ github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdus github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= @@ -89,6 +89,8 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -322,12 +324,8 @@ github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod index 72c156cf15e0d..94fee13bbfe24 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod @@ -93,13 +93,14 @@ require ( github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/briandowns/spinner v1.23.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-logr/logr v1.4.2 // indirect @@ -124,8 +125,7 @@ require ( github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum index 908ead2935092..4798a24352a51 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum @@ -10,8 +10,8 @@ github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 h1:XD9Kd+baO66 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0/go.mod h1:9ByLz9jISc176DzjIdaRfRKwaitqF8ie6RTvfP8Aufo= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= @@ -54,6 +54,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -215,12 +217,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod b/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod index ff05177cb587d..f767ab1daffe5 100644 --- a/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod @@ -137,7 +137,7 @@ require ( github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -187,8 +187,6 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/richardartoul/molecule v1.0.1-0.20240531184615-7ca0df43c0b3 // indirect github.com/rs/cors v1.11.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect @@ -239,11 +237,13 @@ require ( ) require ( + github.com/ebitengine/purego v0.8.1 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect go.opentelemetry.io/collector/client v1.21.0 // indirect go.opentelemetry.io/collector/config/configauth v0.115.0 // indirect go.opentelemetry.io/collector/config/configcompression v1.21.0 // indirect diff --git a/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum b/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum index 691529b929edd..b2344c6db0ff7 100644 --- a/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum @@ -14,8 +14,8 @@ github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdus github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= @@ -60,6 +60,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -271,12 +273,8 @@ github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWN github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/otelcol/otlp/components/statsprocessor/go.mod b/comp/otelcol/otlp/components/statsprocessor/go.mod index 907edfd516589..9df46434c305c 100644 --- a/comp/otelcol/otlp/components/statsprocessor/go.mod +++ b/comp/otelcol/otlp/components/statsprocessor/go.mod @@ -52,6 +52,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -73,8 +74,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/tinylib/msgp v1.2.4 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect diff --git a/comp/otelcol/otlp/components/statsprocessor/go.sum b/comp/otelcol/otlp/components/statsprocessor/go.sum index 520e6d9e0d851..d1dd6e5377312 100644 --- a/comp/otelcol/otlp/components/statsprocessor/go.sum +++ b/comp/otelcol/otlp/components/statsprocessor/go.sum @@ -34,6 +34,8 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -99,12 +101,8 @@ github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= diff --git a/comp/otelcol/otlp/testutil/go.mod b/comp/otelcol/otlp/testutil/go.mod index 4db266071873e..ebc99a3dd4da4 100644 --- a/comp/otelcol/otlp/testutil/go.mod +++ b/comp/otelcol/otlp/testutil/go.mod @@ -63,10 +63,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -84,8 +85,7 @@ require ( github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/comp/otelcol/otlp/testutil/go.sum b/comp/otelcol/otlp/testutil/go.sum index 4b7a189aa89a0..b4642ab1ea7f1 100644 --- a/comp/otelcol/otlp/testutil/go.sum +++ b/comp/otelcol/otlp/testutil/go.sum @@ -6,8 +6,8 @@ github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTF github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -44,6 +44,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -187,12 +189,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/comp/serializer/compression/go.mod b/comp/serializer/compression/go.mod index 2fd30c52fb34f..7540d0254c299 100644 --- a/comp/serializer/compression/go.mod +++ b/comp/serializer/compression/go.mod @@ -63,10 +63,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -80,8 +81,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/comp/serializer/compression/go.sum b/comp/serializer/compression/go.sum index c969810bfb058..47b6f74242930 100644 --- a/comp/serializer/compression/go.sum +++ b/comp/serializer/compression/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= @@ -41,6 +41,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -171,12 +173,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/go.mod b/go.mod index 1d48e947979d0..a0b1c786a0280 100644 --- a/go.mod +++ b/go.mod @@ -166,7 +166,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 github.com/DataDog/sketches-go v1.4.6 - github.com/DataDog/viper v1.13.5 + github.com/DataDog/viper v1.14.0 github.com/DataDog/watermarkpodautoscaler v0.5.3-0.20241023200123-ab786c1724cf github.com/DataDog/zstd v1.5.6 github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f // indirect @@ -615,7 +615,10 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.115.0 ) -require go.opentelemetry.io/collector/component/componenttest v0.115.0 +require ( + github.com/shirou/gopsutil/v4 v4.24.11 + go.opentelemetry.io/collector/component/componenttest v0.115.0 +) require ( go.opentelemetry.io/collector/extension/extensiontest v0.115.0 // indirect @@ -972,7 +975,6 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 // indirect - github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/signalfx/sapm-proto v0.17.0 // indirect github.com/sigstore/rekor v1.2.2 // indirect diff --git a/go.sum b/go.sum index bf22e29643077..eff56174f57ba 100644 --- a/go.sum +++ b/go.sum @@ -176,8 +176,8 @@ github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vH github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= github.com/DataDog/trivy v0.0.0-20241126101205-8517f9b946f4 h1:UVL5oU/8o0JhEv8Js6qxJgiqeV+PzPw/aldojyexS/U= github.com/DataDog/trivy v0.0.0-20241126101205-8517f9b946f4/go.mod h1:hLiUAm3v175M5jWbq34TdGmX6mvHIJY7FMuZ3wBugtw= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/walker v0.0.0-20230418153152-7f29bb2dc950 h1:2imDajw3V85w1iqHsuXN+hUBZQVF+r9eME8tsPq/HpA= github.com/DataDog/walker v0.0.0-20230418153152-7f29bb2dc950/go.mod h1:FU+7qU8DeQQgSZDmmThMJi93kPkLFgy0oVAcLxurjIk= github.com/DataDog/watermarkpodautoscaler v0.5.3-0.20241023200123-ab786c1724cf h1:nbsZ9srTWTTlHzWDGkVE6R5hnqENXTK9N8doMC2YPps= diff --git a/pkg/api/go.mod b/pkg/api/go.mod index 0fd5914a9094d..cc581a79c93ff 100644 --- a/pkg/api/go.mod +++ b/pkg/api/go.mod @@ -68,10 +68,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -85,8 +86,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/api/go.sum b/pkg/api/go.sum index 1441562d69bde..e3973187c6caa 100644 --- a/pkg/api/go.sum +++ b/pkg/api/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -39,6 +39,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -169,12 +171,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/collector/corechecks/servicediscovery/module/comm_test.go b/pkg/collector/corechecks/servicediscovery/module/comm_test.go index 23568d19ecd2c..5cdcac6d5a368 100644 --- a/pkg/collector/corechecks/servicediscovery/module/comm_test.go +++ b/pkg/collector/corechecks/servicediscovery/module/comm_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/collector/corechecks/servicediscovery/module/envs.go b/pkg/collector/corechecks/servicediscovery/module/envs.go index 0c841b3d108c5..2c958586098c8 100644 --- a/pkg/collector/corechecks/servicediscovery/module/envs.go +++ b/pkg/collector/corechecks/servicediscovery/module/envs.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/servicediscovery/envs" "github.com/DataDog/datadog-agent/pkg/util/kernel" diff --git a/pkg/collector/corechecks/servicediscovery/module/envs_test.go b/pkg/collector/corechecks/servicediscovery/module/envs_test.go index 3d2987797ff0a..c1ff43cb82d98 100644 --- a/pkg/collector/corechecks/servicediscovery/module/envs_test.go +++ b/pkg/collector/corechecks/servicediscovery/module/envs_test.go @@ -13,7 +13,7 @@ import ( "strings" "testing" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/stretchr/testify/require" "golang.org/x/sys/unix" diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go index dca31b0890c33..defee82dc4c72 100644 --- a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go +++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go @@ -21,7 +21,7 @@ import ( "time" agentPayload "github.com/DataDog/agent-payload/v5/process" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/DataDog/datadog-agent/cmd/system-probe/api/module" sysconfigtypes "github.com/DataDog/datadog-agent/cmd/system-probe/config/types" diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go index a578ccce8cc8e..d40a5216f1355 100644 --- a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go +++ b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go @@ -32,7 +32,7 @@ import ( "github.com/golang/mock/gomock" gorillamux "github.com/gorilla/mux" "github.com/prometheus/procfs" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vishvananda/netns" diff --git a/pkg/collector/corechecks/servicediscovery/usm/ruby.go b/pkg/collector/corechecks/servicediscovery/usm/ruby.go index 5404a1753d77d..a0d0a5e8ea42b 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/ruby.go +++ b/pkg/collector/corechecks/servicediscovery/usm/ruby.go @@ -14,7 +14,7 @@ import ( "path" "regexp" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/DataDog/datadog-agent/pkg/util/log" ) diff --git a/pkg/collector/corechecks/snmp/integration_profile_bundle_test.go b/pkg/collector/corechecks/snmp/integration_profile_bundle_test.go deleted file mode 100644 index 6e7c55f230fcc..0000000000000 --- a/pkg/collector/corechecks/snmp/integration_profile_bundle_test.go +++ /dev/null @@ -1,53 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-2020 Datadog, Inc. - -package snmp - -import ( - "path/filepath" - "testing" - "time" - - "github.com/stretchr/testify/assert" - - "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" - nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" - "github.com/DataDog/datadog-agent/pkg/aggregator" - "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" - - "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/checkconfig" - "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/common" - "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/session" -) - -func TestProfileBundleJsonZip(t *testing.T) { - timeNow = common.MockTimeNow - aggregator.NewBufferedAggregator(nil, nil, nil, nooptagger.NewComponent(), "", 1*time.Hour) - invalidPath, _ := filepath.Abs(filepath.Join("internal", "test", "zipprofiles.d")) - pkgconfigsetup.Datadog().SetWithoutSource("confd_path", invalidPath) - - sess := session.CreateMockSession() - sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { - return sess, nil - } - chk := Check{sessionFactory: sessionFactory} - // language=yaml - rawInstanceConfig := []byte(` -ip_address: 1.2.3.4 -community_string: public -profile: profile-from-ui -oid_batch_size: 20 -namespace: profile-metadata -collect_topology: false -`) - // language=yaml - rawInitConfig := []byte(``) - senderManager := mocksender.CreateDefaultDemultiplexer() - err := chk.Configure(senderManager, integration.FakeConfigHash, rawInstanceConfig, rawInitConfig, "test") - assert.NoError(t, err) - - assert.Contains(t, chk.config.Profiles, "profile-from-ui") -} diff --git a/pkg/collector/corechecks/snmp/internal/checkconfig/config.go b/pkg/collector/corechecks/snmp/internal/checkconfig/config.go index 9084d26e664e7..688b2cd9350e2 100644 --- a/pkg/collector/corechecks/snmp/internal/checkconfig/config.go +++ b/pkg/collector/corechecks/snmp/internal/checkconfig/config.go @@ -48,7 +48,6 @@ const defaultWorkers = 5 const defaultDiscoveryWorkers = 5 const defaultDiscoveryAllowedFailures = 3 const defaultDiscoveryInterval = 3600 -const defaultDetectMetricsRefreshInterval = 3600 // subnetTagKey is the prefix used for subnet tag const subnetTagKey = "autodiscovery_subnet" @@ -80,18 +79,16 @@ type DeviceDigest string // InitConfig is used to deserialize integration init config type InitConfig struct { - Profiles profile.ProfileConfigMap `yaml:"profiles"` - GlobalMetrics []profiledefinition.MetricsConfig `yaml:"global_metrics"` - OidBatchSize Number `yaml:"oid_batch_size"` - BulkMaxRepetitions Number `yaml:"bulk_max_repetitions"` - CollectDeviceMetadata Boolean `yaml:"collect_device_metadata"` - CollectTopology Boolean `yaml:"collect_topology"` - UseDeviceIDAsHostname Boolean `yaml:"use_device_id_as_hostname"` - MinCollectionInterval int `yaml:"min_collection_interval"` - Namespace string `yaml:"namespace"` - PingConfig snmpintegration.PackedPingConfig `yaml:"ping"` - DetectMetricsEnabled Boolean `yaml:"experimental_detect_metrics_enabled"` - DetectMetricsRefreshInterval int `yaml:"experimental_detect_metrics_refresh_interval"` + Profiles profile.ProfileConfigMap `yaml:"profiles"` + GlobalMetrics []profiledefinition.MetricsConfig `yaml:"global_metrics"` + OidBatchSize Number `yaml:"oid_batch_size"` + BulkMaxRepetitions Number `yaml:"bulk_max_repetitions"` + CollectDeviceMetadata Boolean `yaml:"collect_device_metadata"` + CollectTopology Boolean `yaml:"collect_topology"` + UseDeviceIDAsHostname Boolean `yaml:"use_device_id_as_hostname"` + MinCollectionInterval int `yaml:"min_collection_interval"` + Namespace string `yaml:"namespace"` + PingConfig snmpintegration.PackedPingConfig `yaml:"ping"` } // InstanceConfig is used to deserialize integration instance config @@ -147,11 +144,6 @@ type InstanceConfig struct { Workers int `yaml:"workers"` Namespace string `yaml:"namespace"` - // When DetectMetricsEnabled is enabled, instead of using profile detection using sysObjectID - // the integration will fetch OIDs from the devices and deduct which metrics can be monitored (from all OOTB profile metrics definition) - DetectMetricsEnabled *Boolean `yaml:"experimental_detect_metrics_enabled"` - DetectMetricsRefreshInterval int `yaml:"experimental_detect_metrics_refresh_interval"` - // `interface_configs` option is not supported by SNMP corecheck autodiscovery (`network_address`) // it's only supported for single device instance (`ip_address`) InterfaceConfigs InterfaceConfigs `yaml:"interface_configs"` @@ -184,10 +176,9 @@ type CheckConfig struct { MetricTags []profiledefinition.MetricTagConfig OidBatchSize int BulkMaxRepetitions uint32 - Profiles profile.ProfileConfigMap + ProfileProvider profile.Provider ProfileTags []string - Profile string - ProfileDef *profiledefinition.ProfileDefinition + ProfileName string ExtraTags []string InstanceTags []string CollectDeviceMetadata bool @@ -200,9 +191,6 @@ type CheckConfig struct { AutodetectProfile bool MinCollectionInterval time.Duration - DetectMetricsEnabled bool - DetectMetricsRefreshInterval int - Network string DiscoveryWorkers int Workers int @@ -216,41 +204,33 @@ type CheckConfig struct { } // SetProfile refreshes config based on profile -func (c *CheckConfig) SetProfile(profile string) error { - if _, ok := c.Profiles[profile]; !ok { - return fmt.Errorf("unknown profile `%s`", profile) +func (c *CheckConfig) SetProfile(profileName string) error { + profileConf := c.ProfileProvider.GetProfile(profileName) + if profileConf == nil { + return fmt.Errorf("unknown profile `%s`", profileName) } - log.Debugf("Refreshing with profile `%s`", profile) - tags := []string{"snmp_profile:" + profile} - definition := c.Profiles[profile].Definition - c.ProfileDef = &definition - c.Profile = profile + log.Debugf("Refreshing with profile `%s`", profileName) + c.ProfileName = profileName if log.ShouldLog(log.DebugLvl) { - profileDefJSON, _ := json.Marshal(definition) - log.Debugf("Profile content `%s`: %s", profile, string(profileDefJSON)) - } - - if definition.Device.Vendor != "" { - tags = append(tags, "device_vendor:"+definition.Device.Vendor) + profileDefJSON, _ := json.Marshal(profileConf.Definition) + log.Debugf("Profile content `%s`: %s", profileName, string(profileDefJSON)) } - tags = append(tags, definition.StaticTags...) - c.ProfileTags = tags c.RebuildMetadataMetricsAndTags() return nil } -// SetAutodetectProfile sets the profile to the provided auto-detected metrics -// and tags. This overwrites any preexisting profile but does not affect -// RequestedMetrics or RequestedMetricTags, which will still be queried. -func (c *CheckConfig) SetAutodetectProfile(metrics []profiledefinition.MetricsConfig, tags []profiledefinition.MetricTagConfig) { - c.Profile = "autodetect" - c.ProfileDef = &profiledefinition.ProfileDefinition{ - Metrics: metrics, - MetricTags: tags, +// GetProfileDef returns the autodetected profile definition if there is one, +// the active profile if it exists, or nil if neither is true. +func (c *CheckConfig) GetProfileDef() *profiledefinition.ProfileDefinition { + if c.ProfileName != "" { + profile := c.ProfileProvider.GetProfile(c.ProfileName) + if profile != nil { + return &profile.Definition + } + log.Warnf("profile `%s` not found", c.ProfileName) } - c.ProfileTags = nil - c.RebuildMetadataMetricsAndTags() + return nil } // RebuildMetadataMetricsAndTags rebuilds c.Metrics, c.Metadata, c.MetricTags, @@ -259,10 +239,17 @@ func (c *CheckConfig) SetAutodetectProfile(metrics []profiledefinition.MetricsCo func (c *CheckConfig) RebuildMetadataMetricsAndTags() { c.Metrics = c.RequestedMetrics c.MetricTags = c.RequestedMetricTags - if c.ProfileDef != nil { - c.Metadata = updateMetadataDefinitionWithDefaults(c.ProfileDef.Metadata, c.CollectTopology) - c.Metrics = append(c.Metrics, c.ProfileDef.Metrics...) - c.MetricTags = append(c.MetricTags, c.ProfileDef.MetricTags...) + c.ProfileTags = nil + profileDef := c.GetProfileDef() + if profileDef != nil { + c.ProfileTags = append(c.ProfileTags, "snmp_profile:"+c.ProfileName) + if profileDef.Device.Vendor != "" { + c.ProfileTags = append(c.ProfileTags, "device_vendor:"+profileDef.Device.Vendor) + } + c.ProfileTags = append(c.ProfileTags, profileDef.StaticTags...) + c.Metadata = updateMetadataDefinitionWithDefaults(profileDef.Metadata, c.CollectTopology) + c.Metrics = append(c.Metrics, profileDef.Metrics...) + c.MetricTags = append(c.MetricTags, profileDef.MetricTags...) } else { c.Metadata = updateMetadataDefinitionWithDefaults(nil, c.CollectTopology) } @@ -394,20 +381,6 @@ func NewCheckConfig(rawInstance integration.Data, rawInitConfig integration.Data c.CollectTopology = bool(initConfig.CollectTopology) } - if instance.DetectMetricsEnabled != nil { - c.DetectMetricsEnabled = bool(*instance.DetectMetricsEnabled) - } else { - c.DetectMetricsEnabled = bool(initConfig.DetectMetricsEnabled) - } - - if instance.DetectMetricsRefreshInterval != 0 { - c.DetectMetricsRefreshInterval = int(instance.DetectMetricsRefreshInterval) - } else if initConfig.DetectMetricsRefreshInterval != 0 { - c.DetectMetricsRefreshInterval = int(initConfig.DetectMetricsRefreshInterval) - } else { - c.DetectMetricsRefreshInterval = defaultDetectMetricsRefreshInterval - } - if instance.UseDeviceIDAsHostname != nil { c.UseDeviceIDAsHostname = bool(*instance.UseDeviceIDAsHostname) } else { @@ -519,15 +492,15 @@ func NewCheckConfig(rawInstance integration.Data, rawInitConfig integration.Data return nil, err } - profiles, err := profile.GetProfiles(initConfig.Profiles) + profiles, err := profile.GetProfileProvider(initConfig.Profiles) if err != nil { return nil, err } - c.Profiles = profiles + c.ProfileProvider = profiles // profile configs - profile := instance.Profile - if profile != "" || len(instance.Metrics) > 0 { + profileName := instance.Profile + if profileName != "" || len(instance.Metrics) > 0 { c.AutodetectProfile = false } else { c.AutodetectProfile = true @@ -552,10 +525,10 @@ func NewCheckConfig(rawInstance integration.Data, rawInitConfig integration.Data return nil, fmt.Errorf("validation errors: %s", strings.Join(errors, "\n")) } - if profile != "" { - err = c.SetProfile(profile) + if profileName != "" { + err = c.SetProfile(profileName) if err != nil { - return nil, fmt.Errorf("failed to refresh with profile `%s`: %s", profile, err) + return nil, fmt.Errorf("failed to refresh with profile `%s`: %s", profileName, err) } } else { c.RebuildMetadataMetricsAndTags() @@ -688,10 +661,9 @@ func (c *CheckConfig) Copy() *CheckConfig { copy(newConfig.MetricTags, c.MetricTags) newConfig.OidBatchSize = c.OidBatchSize newConfig.BulkMaxRepetitions = c.BulkMaxRepetitions - newConfig.Profiles = c.Profiles + newConfig.ProfileProvider = c.ProfileProvider newConfig.ProfileTags = netutils.CopyStrings(c.ProfileTags) - newConfig.Profile = c.Profile - newConfig.ProfileDef = c.ProfileDef + newConfig.ProfileName = c.ProfileName newConfig.ExtraTags = netutils.CopyStrings(c.ExtraTags) newConfig.InstanceTags = netutils.CopyStrings(c.InstanceTags) newConfig.CollectDeviceMetadata = c.CollectDeviceMetadata @@ -703,8 +675,6 @@ func (c *CheckConfig) Copy() *CheckConfig { newConfig.ResolvedSubnetName = c.ResolvedSubnetName newConfig.Namespace = c.Namespace newConfig.AutodetectProfile = c.AutodetectProfile - newConfig.DetectMetricsEnabled = c.DetectMetricsEnabled - newConfig.DetectMetricsRefreshInterval = c.DetectMetricsRefreshInterval newConfig.MinCollectionInterval = c.MinCollectionInterval newConfig.InterfaceConfigs = c.InterfaceConfigs diff --git a/pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go b/pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go index 07b6ba9eefaa4..ef9b8628da93a 100644 --- a/pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go +++ b/pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go @@ -250,7 +250,7 @@ bulk_max_repetitions: 20 assert.Equal(t, expectedMetrics, config.Metrics) assert.Equal(t, expectedMetricTags, config.MetricTags) assert.Equal(t, []string{"snmp_profile:f5-big-ip", "device_vendor:f5", "static_tag:from_profile_root", "static_tag:from_base_profile"}, config.ProfileTags) - assert.Equal(t, 1, len(config.Profiles)) + assert.True(t, config.ProfileProvider.HasProfile("f5-big-ip")) assert.Equal(t, "default:1.2.3.4", config.DeviceID) assert.Equal(t, []string{"device_namespace:default", "snmp_device:1.2.3.4"}, config.DeviceIDTags) assert.Equal(t, "127.0.0.0/30", config.ResolvedSubnetName) @@ -372,7 +372,8 @@ profiles: assert.Equal(t, "123", config.CommunityString) assert.Equal(t, metrics, config.Metrics) assert.Equal(t, metricsTags, config.MetricTags) - assert.Equal(t, 2, len(config.Profiles)) + assert.True(t, config.ProfileProvider.HasProfile("f5-big-ip")) + assert.True(t, config.ProfileProvider.HasProfile("inline-profile")) assert.Equal(t, "default:1.2.3.4", config.DeviceID) assert.Equal(t, []string{"device_namespace:default", "snmp_device:1.2.3.4"}, config.DeviceIDTags) assert.Equal(t, false, config.AutodetectProfile) @@ -406,8 +407,10 @@ community_string: abc assert.Equal(t, metrics, config.Metrics) assert.Equal(t, metricsTags, config.MetricTags) - assert.Equal(t, 2, len(config.Profiles)) - assert.Equal(t, profile.FixtureProfileDefinitionMap()["f5-big-ip"].Definition.Metrics, config.Profiles["f5-big-ip"].Definition.Metrics) + // assert.Equal(t, 2, len(config.Profiles)) + assert.True(t, config.ProfileProvider.HasProfile("f5-big-ip")) + assert.True(t, config.ProfileProvider.HasProfile("another_profile")) + assert.Equal(t, profile.FixtureProfileDefinitionMap()["f5-big-ip"].Definition.Metrics, config.ProfileProvider.GetProfile("f5-big-ip").Definition.Metrics) } func TestPortConfiguration(t *testing.T) { @@ -927,17 +930,17 @@ func Test_snmpConfig_setProfile(t *testing.T) { SysObjectIDs: profiledefinition.StringArray{"1.3.6.1.4.1.3375.2.1.3.4.*"}, } - mockProfiles := profile.ProfileConfigMap{ + mockProfiles := profile.StaticProvider(profile.ProfileConfigMap{ "profile1": profile.ProfileConfig{ Definition: profile1, }, "profile2": profile.ProfileConfig{ Definition: profile2, }, - } + }) c := &CheckConfig{ - IPAddress: "1.2.3.4", - Profiles: mockProfiles, + IPAddress: "1.2.3.4", + ProfileProvider: mockProfiles, } err := c.SetProfile("f5") assert.EqualError(t, err, "unknown profile `f5`") @@ -945,8 +948,8 @@ func Test_snmpConfig_setProfile(t *testing.T) { err = c.SetProfile("profile1") assert.NoError(t, err) - assert.Equal(t, "profile1", c.Profile) - assert.Equal(t, profile1, *c.ProfileDef) + assert.Equal(t, "profile1", c.ProfileName) + assert.Equal(t, &profile1, c.GetProfileDef()) assert.Equal(t, metrics, c.Metrics) assert.Equal(t, []profiledefinition.MetricTagConfig{ {Tag: "location", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.1.6.0", Name: "sysLocation"}}, @@ -959,7 +962,7 @@ func Test_snmpConfig_setProfile(t *testing.T) { c = &CheckConfig{ IPAddress: "1.2.3.4", - Profiles: mockProfiles, + ProfileProvider: mockProfiles, CollectDeviceMetadata: true, CollectTopology: false, } @@ -1000,7 +1003,7 @@ func Test_snmpConfig_setProfile(t *testing.T) { c = &CheckConfig{ IPAddress: "1.2.3.4", - Profiles: mockProfiles, + ProfileProvider: mockProfiles, CollectDeviceMetadata: true, CollectTopology: false, } @@ -1331,181 +1334,6 @@ use_device_id_as_hostname: true assert.Equal(t, false, config.UseDeviceIDAsHostname) } -func Test_buildConfig_DetectMetricsEnabled(t *testing.T) { - // language=yaml - rawInstanceConfig := []byte(` -ip_address: 1.2.3.4 -community_string: "abc" -`) - // language=yaml - rawInitConfig := []byte(` -oid_batch_size: 10 -`) - config, err := NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - assert.Equal(t, false, config.DetectMetricsEnabled) - - // language=yaml - rawInstanceConfig = []byte(` -ip_address: 1.2.3.4 -community_string: "abc" -`) - // language=yaml - rawInitConfig = []byte(` -oid_batch_size: 10 -experimental_detect_metrics_enabled: true -`) - config, err = NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - assert.Equal(t, true, config.DetectMetricsEnabled) - - // language=yaml - rawInstanceConfig = []byte(` -ip_address: 1.2.3.4 -community_string: "abc" -experimental_detect_metrics_enabled: true -`) - // language=yaml - rawInitConfig = []byte(` -oid_batch_size: 10 -`) - config, err = NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - assert.Equal(t, true, config.DetectMetricsEnabled) - - // language=yaml - rawInstanceConfig = []byte(` -ip_address: 1.2.3.4 -community_string: "abc" -experimental_detect_metrics_enabled: false -`) - // language=yaml - rawInitConfig = []byte(` -oid_batch_size: 10 -experimental_detect_metrics_enabled: true -`) - config, err = NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - assert.Equal(t, false, config.DetectMetricsEnabled) -} - -func TestSetAutodetectPreservesRequests(t *testing.T) { - metric := func(oid, name string) profiledefinition.MetricsConfig { - return profiledefinition.MetricsConfig{Symbol: profiledefinition.SymbolConfig{OID: oid, Name: name}} - } - - met1 := metric("1.1", "metricOne") - met2 := metric("1.2", "metricTwo") - met3 := metric("1.3", "metricThree") - tag1 := profiledefinition.MetricTagConfig{Tag: "tag_one", Symbol: profiledefinition.SymbolConfigCompat{OID: "2.1", Name: "tagOne"}} - tag2 := profiledefinition.MetricTagConfig{Tag: "tag_two", Symbol: profiledefinition.SymbolConfigCompat{OID: "2.2", Name: "tagTwo"}} - tag3 := profiledefinition.MetricTagConfig{Tag: "tag_three", Symbol: profiledefinition.SymbolConfigCompat{OID: "2.3", Name: "tagThree"}} - - config := &CheckConfig{ - CollectTopology: false, - RequestedMetrics: []profiledefinition.MetricsConfig{met1}, - RequestedMetricTags: []profiledefinition.MetricTagConfig{tag1}, - } - - config.RebuildMetadataMetricsAndTags() - - assert.Equal(t, []profiledefinition.MetricsConfig{met1}, config.Metrics) - assert.Equal(t, []profiledefinition.MetricTagConfig{tag1}, config.MetricTags) - assert.Equal(t, OidConfig{ - ScalarOids: []string{ - "1.1", - "2.1", - }, - ColumnOids: nil, - }, config.OidConfig) - - config.SetAutodetectProfile([]profiledefinition.MetricsConfig{met2}, []profiledefinition.MetricTagConfig{tag2}) - - assert.Equal(t, []profiledefinition.MetricsConfig{met1, met2}, config.Metrics) - assert.Equal(t, []profiledefinition.MetricTagConfig{tag1, tag2}, config.MetricTags) - assert.Equal(t, OidConfig{ - ScalarOids: []string{ - "1.1", - "1.2", - "2.1", - "2.2", - }, - ColumnOids: nil, - }, config.OidConfig) - - config.SetAutodetectProfile([]profiledefinition.MetricsConfig{met3}, []profiledefinition.MetricTagConfig{tag3}) - - assert.Equal(t, []profiledefinition.MetricsConfig{met1, met3}, config.Metrics) - assert.Equal(t, []profiledefinition.MetricTagConfig{tag1, tag3}, config.MetricTags) - assert.Equal(t, OidConfig{ - ScalarOids: []string{ - "1.1", - "1.3", - "2.1", - "2.3", - }, - ColumnOids: nil, - }, config.OidConfig) -} - -func Test_buildConfig_DetectMetricsRefreshInterval(t *testing.T) { - // language=yaml - rawInstanceConfig := []byte(` -ip_address: 1.2.3.4 -community_string: "abc" -`) - // language=yaml - rawInitConfig := []byte(` -oid_batch_size: 10 -`) - config, err := NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - assert.Equal(t, 3600, config.DetectMetricsRefreshInterval) - - // language=yaml - rawInstanceConfig = []byte(` -ip_address: 1.2.3.4 -community_string: "abc" -`) - // language=yaml - rawInitConfig = []byte(` -oid_batch_size: 10 -experimental_detect_metrics_refresh_interval: 10 -`) - config, err = NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - assert.Equal(t, 10, config.DetectMetricsRefreshInterval) - - // language=yaml - rawInstanceConfig = []byte(` -ip_address: 1.2.3.4 -community_string: "abc" -experimental_detect_metrics_refresh_interval: 10 -`) - // language=yaml - rawInitConfig = []byte(` -oid_batch_size: 20 -`) - config, err = NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - assert.Equal(t, 10, config.DetectMetricsRefreshInterval) - - // language=yaml - rawInstanceConfig = []byte(` -ip_address: 1.2.3.4 -community_string: "abc" -experimental_detect_metrics_refresh_interval: 20 -`) - // language=yaml - rawInitConfig = []byte(` -oid_batch_size: 10 -experimental_detect_metrics_refresh_interval: 30 -`) - config, err = NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - assert.Equal(t, 20, config.DetectMetricsRefreshInterval) -} - func Test_buildConfig_minCollectionInterval(t *testing.T) { tests := []struct { name string @@ -2113,16 +1941,13 @@ func TestCheckConfig_Copy(t *testing.T) { }, OidBatchSize: 10, BulkMaxRepetitions: 10, - Profiles: profile.ProfileConfigMap{"f5-big-ip": profile.ProfileConfig{ + ProfileProvider: profile.StaticProvider(profile.ProfileConfigMap{"f5-big-ip": profile.ProfileConfig{ Definition: profiledefinition.ProfileDefinition{ Device: profiledefinition.DeviceMeta{Vendor: "f5"}, }, - }}, - ProfileTags: []string{"profile_tag:atag"}, - Profile: "f5", - ProfileDef: &profiledefinition.ProfileDefinition{ - Device: profiledefinition.DeviceMeta{Vendor: "f5"}, - }, + }}), + ProfileTags: []string{"profile_tag:atag"}, + ProfileName: "f5", ExtraTags: []string{"ExtraTags:tag"}, InstanceTags: []string{"InstanceTags:tag"}, CollectDeviceMetadata: true, diff --git a/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go b/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go index f63d0a4c33791..969fd45d2da52 100644 --- a/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go +++ b/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go @@ -26,14 +26,12 @@ import ( "github.com/DataDog/datadog-agent/pkg/networkdevice/metadata" "github.com/DataDog/datadog-agent/pkg/networkdevice/pinger" - "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" "github.com/DataDog/datadog-agent/pkg/networkdevice/utils" coresnmp "github.com/DataDog/datadog-agent/pkg/snmp" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/checkconfig" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/common" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/fetch" - "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/profile" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/report" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/session" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/valuestore" @@ -56,9 +54,6 @@ const ( checkDurationThreshold = 30 // Thirty seconds ) -// define timeNow as variable to make it possible to mock it during test -var timeNow = time.Now - // DeviceCheck hold info necessary to collect info for a single device type DeviceCheck struct { config *checkconfig.CheckConfig @@ -68,7 +63,6 @@ type DeviceCheck struct { devicePinger pinger.Pinger sessionCloseErrorCount *atomic.Uint64 savedDynamicTags []string - nextAutodetectMetrics time.Time diagnoses *diagnoses.Diagnoses interfaceBandwidthState report.InterfaceBandwidthState cacheKey string @@ -97,7 +91,6 @@ func NewDeviceCheck(config *checkconfig.CheckConfig, ipAddress string, sessionFa sessionFactory: sessionFactory, devicePinger: devicePinger, sessionCloseErrorCount: atomic.NewUint64(0), - nextAutodetectMetrics: timeNow(), diagnoses: diagnoses.NewDeviceDiagnoses(newConfig.DeviceID), interfaceBandwidthState: report.MakeInterfaceBandwidthState(), cacheKey: cacheKey, @@ -315,30 +308,21 @@ func (d *DeviceCheck) getValuesAndTags() (bool, []string, *valuestore.ResultValu } func (d *DeviceCheck) detectMetricsToMonitor(sess session.Session) error { - if d.config.DetectMetricsEnabled { - if d.nextAutodetectMetrics.After(timeNow()) { - return nil - } - d.nextAutodetectMetrics = d.nextAutodetectMetrics.Add(time.Duration(d.config.DetectMetricsRefreshInterval) * time.Second) - - detectedMetrics, metricTagConfigs := d.detectAvailableMetrics() - log.Debugf("detected metrics: %v", detectedMetrics) - d.config.SetAutodetectProfile(detectedMetrics, metricTagConfigs) - } else if d.config.AutodetectProfile { + if d.config.AutodetectProfile { // detect using sysObjectID sysObjectID, err := session.FetchSysObjectID(sess) if err != nil { return fmt.Errorf("failed to fetch sysobjectid: %s", err) } - profile, err := profile.GetProfileForSysObjectID(d.config.Profiles, sysObjectID) + profile, err := d.config.ProfileProvider.GetProfileNameForSysObjectID(sysObjectID) if err != nil { return fmt.Errorf("failed to get profile sys object id for `%s`: %s", sysObjectID, err) } - if profile != d.config.Profile { - log.Debugf("detected profile change: %s -> %s", d.config.Profile, profile) + if profile != d.config.ProfileName { + log.Debugf("detected profile change: %s -> %s", d.config.ProfileName, profile) err = d.config.SetProfile(profile) if err != nil { - // Should not happen since the profile is one of those we matched in GetProfileForSysObjectID + // Should not happen since the profile is one of those we matched in GetProfileNameForSysObjectID return fmt.Errorf("failed to refresh with profile `%s` detected using sysObjectID `%s`: %s", profile, sysObjectID, err) } } @@ -346,77 +330,6 @@ func (d *DeviceCheck) detectMetricsToMonitor(sess session.Session) error { return nil } -func (d *DeviceCheck) detectAvailableMetrics() ([]profiledefinition.MetricsConfig, []profiledefinition.MetricTagConfig) { - fetchedOIDs := session.FetchAllOIDsUsingGetNext(d.session) - log.Debugf("fetched OIDs: %v", fetchedOIDs) - - root := common.BuildOidTrie(fetchedOIDs) - if log.ShouldLog(log.DebugLvl) { - root.DebugPrint() - } - - var metricConfigs []profiledefinition.MetricsConfig - var metricTagConfigs []profiledefinition.MetricTagConfig - - // If a metric name has already been encountered, we won't try to add it again. - alreadySeenMetrics := make(map[string]bool) - // If a global tag has already been encountered, we won't try to add it again. - alreadyGlobalTags := make(map[string]bool) - for _, profileConfig := range d.config.Profiles { - for _, metricConfig := range profileConfig.Definition.Metrics { - newMetricConfig := metricConfig - if metricConfig.IsScalar() { - metricName := metricConfig.Symbol.Name - if metricConfig.Options.MetricSuffix != "" { - metricName = metricName + "." + metricConfig.Options.MetricSuffix - } - if !alreadySeenMetrics[metricName] && root.LeafExist(metricConfig.Symbol.OID) { - alreadySeenMetrics[metricName] = true - metricConfigs = append(metricConfigs, newMetricConfig) - } - } else if metricConfig.IsColumn() { - newMetricConfig.Symbols = []profiledefinition.SymbolConfig{} - for _, symbol := range metricConfig.Symbols { - if !alreadySeenMetrics[symbol.Name] && root.NonLeafNodeExist(symbol.OID) { - alreadySeenMetrics[symbol.Name] = true - newMetricConfig.Symbols = append(newMetricConfig.Symbols, symbol) - } - } - if len(newMetricConfig.Symbols) > 0 { - metricConfigs = append(metricConfigs, newMetricConfig) - } - } - } - for _, metricTag := range profileConfig.Definition.MetricTags { - if root.LeafExist(metricTag.Symbol.OID) { - if metricTag.Tag != "" { - if alreadyGlobalTags[metricTag.Tag] { - continue - } - alreadyGlobalTags[metricTag.Tag] = true - } else { - // We don't add `metricTag` if any of the `metricTag.Tags` has already been encountered. - alreadyPresent := false - for tagKey := range metricTag.Tags { - if alreadyGlobalTags[tagKey] { - alreadyPresent = true - break - } - } - if alreadyPresent { - continue - } - for tagKey := range metricTag.Tags { - alreadyGlobalTags[tagKey] = true - } - } - metricTagConfigs = append(metricTagConfigs, metricTag) - } - } - } - return metricConfigs, metricTagConfigs -} - func (d *DeviceCheck) submitTelemetryMetrics(startTime time.Time, tags []string) { newTags := append(utils.CopyStrings(tags), snmpLoaderTag, utils.GetAgentVersionTag()) diff --git a/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck_test.go b/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck_test.go index 028e233687aca..c56235171d3a2 100644 --- a/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck_test.go +++ b/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck_test.go @@ -9,7 +9,6 @@ import ( "encoding/json" "errors" "fmt" - "path/filepath" "strings" "testing" "time" @@ -19,18 +18,14 @@ import ( "github.com/stretchr/testify/mock" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/metrics/servicecheck" "github.com/DataDog/datadog-agent/pkg/version" "github.com/DataDog/datadog-agent/pkg/networkdevice/pinger" - "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" "github.com/DataDog/datadog-agent/pkg/networkdevice/utils" "github.com/DataDog/datadog-agent/pkg/snmp/gosnmplib" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/checkconfig" - "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/common" - "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/configvalidation" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/profile" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/report" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/session" @@ -237,225 +232,6 @@ global_metrics: } -func TestDetectMetricsToCollect(t *testing.T) { - timeNow = common.MockTimeNow - defer func() { timeNow = time.Now }() - - profilesWithInvalidExtendConfdPath, _ := filepath.Abs(filepath.Join("..", "test", "detectmetr.d")) - pkgconfigsetup.Datadog().SetWithoutSource("confd_path", profilesWithInvalidExtendConfdPath) - - sess := session.CreateFakeSession() - sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { - return sess, nil - } - - // language=yaml - rawInstanceConfig := []byte(` -ip_address: 1.2.3.4 -community_string: public -experimental_detect_metrics_enabled: true -experimental_detect_metrics_refresh_interval: 10 -collect_topology: false -`) - // language=yaml - rawInitConfig := []byte(``) - - config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) - assert.Nil(t, err) - - sender := mocksender.NewMockSender("123") // required to initiate aggregator - sender.On("Gauge", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return() - sender.On("MonotonicCount", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return() - sender.On("ServiceCheck", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return() - sender.On("EventPlatformEvent", mock.Anything, mock.Anything).Return() - sender.On("Commit").Return() - - deviceCk.SetSender(report.NewMetricSender(sender, "", nil, report.MakeInterfaceBandwidthState())) - - sess. - SetObj("1.3.6.1.2.1.1.2.0", "1.3.6.1.4.1.3375.2.1.3.4.1"). - SetTime("1.3.6.1.2.1.1.3.0", 20). - SetStr("1.3.6.1.2.1.1.1.0", "my_desc"). - SetStr("1.3.6.1.2.1.1.5.0", "foo_sys_name"). - SetStr("1.3.6.1.4.1.318.1.1.1.11.1.1.0", "1010"). - SetInt("1.3.6.1.2.1.2.2.1.13.1", 131). - SetInt("1.3.6.1.2.1.2.2.1.14.1", 141). - SetStr("1.3.6.1.2.1.2.2.1.2.1", `desc1`). - SetByte("1.3.6.1.2.1.2.2.1.6.1", []byte{00, 00, 00, 00, 00, 01}). - SetInt("1.3.6.1.2.1.2.2.1.7.1", 1). - SetInt("1.3.6.1.2.1.2.2.1.13.2", 132). - SetInt("1.3.6.1.2.1.2.2.1.14.2", 142). - SetByte("1.3.6.1.2.1.2.2.1.6.2", []byte{00, 00, 00, 00, 00, 01}). - SetStr("1.3.6.1.2.1.2.2.1.2.2", `desc2`). - SetInt("1.3.6.1.2.1.2.2.1.7.2", 1). - SetInt("1.3.6.1.2.1.2.2.1.8.1", 1). - SetStr("1.3.6.1.2.1.31.1.1.1.1.1", "nameRow1"). - SetStr("1.3.6.1.2.1.31.1.1.1.18.1", "descRow1"). - SetInt("1.3.6.1.2.1.4.20.1.2.10.0.0.1", 1). - SetIP("1.3.6.1.2.1.4.20.1.3.10.0.0.1", "255.255.255.0"). - SetInt("1.3.6.1.2.1.2.2.1.8.2", 1). - SetStr("1.3.6.1.2.1.31.1.1.1.1.2", "nameRow2"). - SetStr("1.3.6.1.2.1.31.1.1.1.18.2", "descRow2"). - SetInt("1.3.6.1.2.1.4.20.1.2.10.0.0.2", 1). - SetIP("1.3.6.1.2.1.4.20.1.3.10.0.0.2", "255.255.255.0") - - savedAutodetectMetricsTime := deviceCk.nextAutodetectMetrics - err = deviceCk.Run(timeNow()) - assert.Nil(t, err) - - snmpTags := []string{"snmp_device:1.2.3.4", "device_ip:1.2.3.4", "device_id:default:1.2.3.4"} - telemetryTags := append(utils.CopyStrings(snmpTags), "agent_version:"+version.AgentVersion) - row1Tags := append(utils.CopyStrings(snmpTags), "interface:nameRow1", "interface_alias:descRow1", "table_static_tag:val") - row2Tags := append(utils.CopyStrings(snmpTags), "interface:nameRow2", "interface_alias:descRow2", "table_static_tag:val") - - sender.AssertMetric(t, "Gauge", "snmp.sysUpTimeInstance", float64(20), "", snmpTags) - sender.AssertMetric(t, "MonotonicCount", "snmp.ifInErrors", float64(70.5), "", row1Tags) - sender.AssertMetric(t, "MonotonicCount", "snmp.ifInErrors", float64(71), "", row2Tags) - sender.AssertMetric(t, "MonotonicCount", "snmp.ifInDiscards", float64(131), "", row1Tags) - sender.AssertMetric(t, "MonotonicCount", "snmp.ifInDiscards", float64(132), "", row2Tags) - sender.AssertNotCalled(t, "Gauge", "snmp.sysStatMemoryTotal", mock.Anything, mock.Anything, mock.Anything) - - sender.AssertMetric(t, "Gauge", "snmp.devices_monitored", float64(1), "", telemetryTags) - sender.AssertMetricTaggedWith(t, "MonotonicCount", "datadog.snmp.check_interval", telemetryTags) - sender.AssertMetricTaggedWith(t, "Gauge", "datadog.snmp.check_duration", telemetryTags) - sender.AssertMetricTaggedWith(t, "Gauge", "datadog.snmp.submitted_metrics", telemetryTags) - - expectedNextAutodetectMetricsTime := savedAutodetectMetricsTime.Add(time.Duration(deviceCk.config.DetectMetricsRefreshInterval) * time.Second) - assert.WithinDuration(t, expectedNextAutodetectMetricsTime, deviceCk.nextAutodetectMetrics, time.Second) - - expectedMetrics := []profiledefinition.MetricsConfig{ - {Symbol: profiledefinition.SymbolConfig{OID: "1.3.6.1.2.1.1.3.0", Name: "sysUpTimeInstance"}}, - {Symbol: profiledefinition.SymbolConfig{OID: "1.3.6.1.4.1.318.1.1.1.11.1.1.0", Name: "upsBasicStateOutputState"}, MetricType: "flag_stream", Options: profiledefinition.MetricsConfigOption{Placement: 1, MetricSuffix: "OnLine"}}, - {Symbol: profiledefinition.SymbolConfig{OID: "1.3.6.1.4.1.318.1.1.1.11.1.1.0", Name: "upsBasicStateOutputState"}, MetricType: "flag_stream", Options: profiledefinition.MetricsConfigOption{Placement: 2, MetricSuffix: "ReplaceBattery"}}, - { - MetricType: profiledefinition.ProfileMetricTypeMonotonicCount, - MIB: "IF-MIB", - Table: profiledefinition.SymbolConfig{ - OID: "1.3.6.1.2.1.2.2", - Name: "ifTable", - }, - Symbols: []profiledefinition.SymbolConfig{ - {OID: "1.3.6.1.2.1.2.2.1.14", Name: "ifInErrors", ScaleFactor: 0.5}, - {OID: "1.3.6.1.2.1.2.2.1.13", Name: "ifInDiscards"}, - }, - MetricTags: []profiledefinition.MetricTagConfig{ - {Tag: "interface", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.31.1.1.1.1", Name: "ifName"}}, - {Tag: "interface_alias", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.31.1.1.1.18", Name: "ifAlias"}}, - {Tag: "mac_address", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.2.2.1.6", Name: "ifPhysAddress", Format: "mac_address"}}, - }, - StaticTags: []string{"table_static_tag:val"}, - }, - } - - expectedMetricTags := []profiledefinition.MetricTagConfig{ - {Tag: "snmp_host2", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.1.5.0", Name: "sysName"}}, - { - Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.1.5.0", Name: "sysName"}, - Match: "(\\w)(\\w+)", - Tags: map[string]string{ - "prefix": "\\1", - "suffix": "\\2", - "some_tag": "some_tag_value", - }, - }, - {Tag: "snmp_host", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.1.5.0", Name: "sysName"}}, - } - configvalidation.ValidateEnrichMetrics(expectedMetrics) - configvalidation.ValidateEnrichMetricTags(expectedMetricTags) - - assert.ElementsMatch(t, deviceCk.config.Metrics, expectedMetrics) - - assert.ElementsMatch(t, deviceCk.config.MetricTags, expectedMetricTags) - - // Add a new metric and make sure it is added but nothing else is re-added - sess.SetInt("1.3.6.1.4.1.3375.2.1.1.2.1.44.0", 30) - sender.ResetCalls() - timeNow = func() time.Time { - return common.MockTimeNow().Add(time.Second * 100) - } - - err = deviceCk.Run(timeNow()) - assert.Nil(t, err) - - sender.AssertMetric(t, "Gauge", "snmp.sysStatMemoryTotal", float64(60), "", snmpTags) - - expectedMetrics = append(expectedMetrics, profiledefinition.MetricsConfig{ - MIB: "F5-BIGIP-SYSTEM-MIB", - Symbol: profiledefinition.SymbolConfig{OID: "1.3.6.1.4.1.3375.2.1.1.2.1.44.0", Name: "sysStatMemoryTotal", ScaleFactor: 2}, - MetricType: profiledefinition.ProfileMetricTypeGauge, - }) - assert.ElementsMatch(t, expectedMetrics, deviceCk.config.Metrics) - assert.ElementsMatch(t, expectedMetricTags, deviceCk.config.MetricTags) - -} - -func TestDetectMetricsToCollect_detectMetricsToMonitor_nextAutodetectMetrics(t *testing.T) { - timeNow = common.MockTimeNow - defer func() { timeNow = time.Now }() - - sess := session.CreateMockSession() - sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { - return sess, nil - } - - // language=yaml - rawInstanceConfig := []byte(` -ip_address: 1.2.3.4 -community_string: public -experimental_detect_metrics_enabled: true -experimental_detect_metrics_refresh_interval: 600 # 10min -`) - // language=yaml - rawInitConfig := []byte(` -profiles: - f5-big-ip: - definition_file: f5-big-ip.yaml -`) - - config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) - assert.Nil(t, err) - - deviceCk.session, err = sessionFactory(config) - assert.Nil(t, err) - - sender := mocksender.NewMockSender("123") // required to initiate aggregator - deviceCk.SetSender(report.NewMetricSender(sender, "", nil, report.MakeInterfaceBandwidthState())) - sess.On("GetNext", []string{"1.0"}).Return(session.CreateGetNextPacket("9999", gosnmp.EndOfMibView, nil), nil) - - deviceCk.detectMetricsToMonitor(sess) - - expectedNextAutodetectMetricsTime := common.MockTimeNow().Add(600 * time.Second) - assert.Equal(t, expectedNextAutodetectMetricsTime, deviceCk.nextAutodetectMetrics) - - // 10 seconds after - timeNow = func() time.Time { - return common.MockTimeNow().Add(10 * time.Second) - } - deviceCk.detectMetricsToMonitor(sess) - assert.Equal(t, expectedNextAutodetectMetricsTime, deviceCk.nextAutodetectMetrics) - - // 599 seconds after - timeNow = func() time.Time { - return common.MockTimeNow().Add(599 * time.Second) - } - deviceCk.detectMetricsToMonitor(sess) - assert.Equal(t, expectedNextAutodetectMetricsTime, deviceCk.nextAutodetectMetrics) - - // 600 seconds after - expectedNextAutodetectMetricsTime = common.MockTimeNow().Add(1200 * time.Second) - timeNow = func() time.Time { - return common.MockTimeNow().Add(600 * time.Second) - } - deviceCk.detectMetricsToMonitor(sess) - assert.Equal(t, expectedNextAutodetectMetricsTime, deviceCk.nextAutodetectMetrics) -} - func TestDeviceCheck_Hostname(t *testing.T) { profile.SetConfdPathAndCleanProfiles() // language=yaml @@ -892,93 +668,6 @@ profiles: assert.Equal(t, uint64(1), deviceCk.sessionCloseErrorCount.Load()) } -func TestDeviceCheck_detectAvailableMetrics(t *testing.T) { - profile.SetConfdPathAndCleanProfiles() - - sess := session.CreateMockSession() - sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { - return sess, nil - } - - // language=yaml - rawInstanceConfig := []byte(` -collect_device_metadata: false -ip_address: 1.2.3.4 -community_string: public -`) - // language=yaml - rawInitConfig := []byte(``) - - config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) - assert.Nil(t, err) - - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) - assert.Nil(t, err) - - deviceCk.session, err = sessionFactory(config) - assert.Nil(t, err) - - sender := mocksender.NewMockSender("123") // required to initiate aggregator - sender.SetupAcceptAll() - - deviceCk.SetSender(report.NewMetricSender(sender, "", nil, report.MakeInterfaceBandwidthState())) - - sess.On("GetNext", []string{"1.0"}).Return(&gosnmplib.MockValidReachableGetNextPacket, nil) - sess.On("GetNext", []string{"1.3.6.1.2.1.1.2.0"}).Return(session.CreateGetNextPacket("1.3.6.1.2.1.1.5.0", gosnmp.OctetString, []byte(`123`)), nil) - sess.On("GetNext", []string{"1.3.6.1.2.1.1.5.0"}).Return(session.CreateGetNextPacket("1.3.6.1.2.1.2.2.1.13.1", gosnmp.OctetString, []byte(`123`)), nil) - sess.On("GetNext", []string{"1.3.6.1.2.1.2.2.1.14"}).Return(session.CreateGetNextPacket("1.3.6.1.2.1.2.2.1.14.1", gosnmp.OctetString, []byte(`123`)), nil) - sess.On("GetNext", []string{"1.3.6.1.2.1.2.2.1.15"}).Return(session.CreateGetNextPacket("1.3.6.1.2.1.2.2.1.15.1", gosnmp.OctetString, []byte(`123`)), nil) - sess.On("GetNext", []string{"1.3.6.1.2.1.2.2.1.16"}).Return(session.CreateGetNextPacket("1.3.6.1.4.1.3375.2.1.1.2.1.44.0", gosnmp.OctetString, []byte(`123`)), nil) - sess.On("GetNext", []string{"1.3.6.1.4.1.3375.2.1.1.2.1.44.0"}).Return(session.CreateGetNextPacket("", gosnmp.EndOfMibView, nil), nil) - - metricsConfigs, metricTagConfigs := deviceCk.detectAvailableMetrics() - - expectedMetricsConfigs := []profiledefinition.MetricsConfig{ - { - MIB: "F5-BIGIP-SYSTEM-MIB", - Symbol: profiledefinition.SymbolConfig{OID: "1.3.6.1.4.1.3375.2.1.1.2.1.44.0", Name: "sysStatMemoryTotal", ScaleFactor: 2}, - MetricType: profiledefinition.ProfileMetricTypeGauge, - }, - { - MIB: "IF-MIB", - Table: profiledefinition.SymbolConfig{ - OID: "1.3.6.1.2.1.2.2", - Name: "ifTable", - }, - MetricType: profiledefinition.ProfileMetricTypeMonotonicCount, - Symbols: []profiledefinition.SymbolConfig{ - {OID: "1.3.6.1.2.1.2.2.1.14", Name: "ifInErrors", ScaleFactor: 0.5}, - {OID: "1.3.6.1.2.1.2.2.1.13", Name: "ifInDiscards"}, - }, - MetricTags: []profiledefinition.MetricTagConfig{ - {Tag: "interface", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.31.1.1.1.1", Name: "ifName"}}, - {Tag: "interface_alias", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.31.1.1.1.18", Name: "ifAlias"}}, - {Tag: "mac_address", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.2.2.1.6", Name: "ifPhysAddress", Format: "mac_address"}}, - }, - StaticTags: []string{"table_static_tag:val"}, - }, - } - assert.ElementsMatch(t, expectedMetricsConfigs, metricsConfigs) - - expectedMetricsTagConfigs := []profiledefinition.MetricTagConfig{ - { - Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.1.5.0", Name: "sysName"}, - Match: "(\\w)(\\w+)", - Tags: map[string]string{ - "some_tag": "some_tag_value", - "prefix": "\\1", - "suffix": "\\2", - }, - }, - {Tag: "snmp_host", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.1.5.0", Name: "sysName"}}, - {Tag: "snmp_host2", Symbol: profiledefinition.SymbolConfigCompat{OID: "1.3.6.1.2.1.1.5.0", Name: "sysName"}}, - } - - configvalidation.ValidateEnrichMetricTags(expectedMetricsTagConfigs) - - assert.ElementsMatch(t, expectedMetricsTagConfigs, metricTagConfigs) -} - func TestDeviceCheck_WithPing(t *testing.T) { profile.SetConfdPathAndCleanProfiles() sess := session.CreateFakeSession() diff --git a/pkg/collector/corechecks/snmp/internal/profile/config_profile.go b/pkg/collector/corechecks/snmp/internal/profile/config_profile.go index a2cca802ba6f5..0cf4355fe3ea7 100644 --- a/pkg/collector/corechecks/snmp/internal/profile/config_profile.go +++ b/pkg/collector/corechecks/snmp/internal/profile/config_profile.go @@ -9,10 +9,48 @@ import ( "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" ) -// ProfileConfigMap represent a map of ProfileConfig +// Provider is an interface that provides profiles by name +type Provider interface { + // HasProfile returns true if and only if we have a profile by this name. + HasProfile(profileName string) bool + // GetProfile returns the profile with this name, or nil if there isn't one. + GetProfile(profileName string) *ProfileConfig + // GetProfileNameForSysObjectID returns the best matching profile for this sysObjectID, or nil if there isn't one. + GetProfileNameForSysObjectID(sysObjectID string) (string, error) +} + +// staticProvider is a static implementation of Provider +type staticProvider struct { + configMap ProfileConfigMap +} + +func (s *staticProvider) GetProfile(name string) *ProfileConfig { + if profile, ok := s.configMap[name]; ok { + return &profile + } + return nil +} + +func (s *staticProvider) HasProfile(profileName string) bool { + _, ok := s.configMap[profileName] + return ok +} + +func (s *staticProvider) GetProfileNameForSysObjectID(sysObjectID string) (string, error) { + return getProfileForSysObjectID(s.configMap, sysObjectID) +} + +// StaticProvider makes a provider that serves the static data from this config map. +func StaticProvider(profiles ProfileConfigMap) Provider { + return &staticProvider{ + configMap: profiles, + } +} + +// ProfileConfigMap is a set of ProfileConfig instances each identified by name. type ProfileConfigMap map[string]ProfileConfig -// ProfileConfig represent a profile configuration +// ProfileConfig represents a profile configuration. type ProfileConfig struct { DefinitionFile string `yaml:"definition_file"` Definition profiledefinition.ProfileDefinition `yaml:"definition"` diff --git a/pkg/collector/corechecks/snmp/internal/profile/profile.go b/pkg/collector/corechecks/snmp/internal/profile/profile.go index 52d61f6170629..916be04fe7035 100644 --- a/pkg/collector/corechecks/snmp/internal/profile/profile.go +++ b/pkg/collector/corechecks/snmp/internal/profile/profile.go @@ -15,12 +15,16 @@ import ( "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" ) -// GetProfiles returns profiles depending on various sources: -// - init config profiles -// - yaml profiles -// - downloaded json gzip profiles -// - remote config profiles -func GetProfiles(initConfigProfiles ProfileConfigMap) (ProfileConfigMap, error) { +// GetProfileProvider returns a Provider that knows the on-disk profiles as well as any overrides from the initConfig. +func GetProfileProvider(initConfigProfiles ProfileConfigMap) (Provider, error) { + profiles, err := loadProfiles(initConfigProfiles) + if err != nil { + return nil, err + } + return StaticProvider(profiles), nil +} + +func loadProfiles(initConfigProfiles ProfileConfigMap) (ProfileConfigMap, error) { var profiles ProfileConfigMap if len(initConfigProfiles) > 0 { // TODO: [PERFORMANCE] Load init config custom profiles once for all integrations @@ -30,12 +34,6 @@ func GetProfiles(initConfigProfiles ProfileConfigMap) (ProfileConfigMap, error) return nil, fmt.Errorf("failed to load profiles from initConfig: %w", err) } profiles = customProfiles - } else if bundlePath := findProfileBundleFilePath(); bundlePath != "" { - defaultProfiles, err := loadBundleJSONProfiles(bundlePath) - if err != nil { - return nil, fmt.Errorf("failed to load profiles from json bundle %q: %w", bundlePath, err) - } - profiles = defaultProfiles } else { defaultProfiles, err := loadYamlProfiles() if err != nil { @@ -49,8 +47,8 @@ func GetProfiles(initConfigProfiles ProfileConfigMap) (ProfileConfigMap, error) return profiles, nil } -// GetProfileForSysObjectID return a profile for a sys object id -func GetProfileForSysObjectID(profiles ProfileConfigMap, sysObjectID string) (string, error) { +// getProfileForSysObjectID return a profile for a sys object id +func getProfileForSysObjectID(profiles ProfileConfigMap, sysObjectID string) (string, error) { tmpSysOidToProfile := map[string]string{} var matchedOids []string diff --git a/pkg/collector/corechecks/snmp/internal/profile/profile_json_bundle.go b/pkg/collector/corechecks/snmp/internal/profile/profile_json_bundle.go deleted file mode 100644 index efe94b970e053..0000000000000 --- a/pkg/collector/corechecks/snmp/internal/profile/profile_json_bundle.go +++ /dev/null @@ -1,100 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -package profile - -import ( - "compress/gzip" - "encoding/json" - "io" - "os" - "path/filepath" - - "github.com/DataDog/datadog-agent/pkg/util/log" - - "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" -) - -// loadBundleJSONProfiles finds the gzipped profile bundle and loads profiles from it. -func loadBundleJSONProfiles(gzipFilePath string) (ProfileConfigMap, error) { - jsonStr, err := loadGzipFile(gzipFilePath) - if err != nil { - return nil, err - } - - userProfiles, err := unmarshallProfilesBundleJSON(jsonStr, gzipFilePath) - if err != nil { - return nil, err - } - // TODO (separate PR): Use default profiles from json Bundle in priority once it's implemented. - // We fallback on Yaml Default Profiles if default profiles are not present in json Bundle. - defaultProfiles := getYamlDefaultProfiles() - - resolvedProfiles, err := resolveProfiles(userProfiles, defaultProfiles) - if err != nil { - return nil, err - } - - return resolvedProfiles, nil -} - -// unmarshallProfilesBundleJSON parses json data into a profile bundle. -// Duplicate profiles and profiles without names will be skipped, and warnings will be logged; -// filenameForLogging is only used for making more readable log messages. -func unmarshallProfilesBundleJSON(raw []byte, filenameForLogging string) (ProfileConfigMap, error) { - bundle := profiledefinition.ProfileBundle{} - err := json.Unmarshal(raw, &bundle) - if err != nil { - return nil, err - } - - profiles := make(ProfileConfigMap) - for i, p := range bundle.Profiles { - if p.Profile.Name == "" { - log.Warnf("ignoring profile #%d from %q - no name provided", i, filenameForLogging) - continue - } - - if _, exist := profiles[p.Profile.Name]; exist { - log.Warnf("ignoring duplicate profile in %q for name %q", filenameForLogging, p.Profile.Name) - continue - } - // TODO: (separate PR) resolve extends with custom + local default profiles (yaml) - profiles[p.Profile.Name] = ProfileConfig{ - Definition: p.Profile, - IsUserProfile: true, - } - } - return profiles, nil -} - -// loadGzipFile extracts the contents of a gzip file. -func loadGzipFile(filePath string) ([]byte, error) { - gzipFile, err := os.Open(filePath) - if err != nil { - return nil, err - } - defer gzipFile.Close() - gzipReader, err := gzip.NewReader(gzipFile) - if err != nil { - return nil, err - } - defer gzipReader.Close() - return io.ReadAll(gzipReader) -} - -// getProfileBundleFilePath returns the expected location of the gzipped profiles bundle, based on config.Datadog(). -func getProfileBundleFilePath() string { - return getProfileConfdRoot(filepath.Join(userProfilesFolder, profilesJSONGzipFile)) -} - -// findProfileBundleFilePath returns the path to the gzipped profiles bundle, or "" if one doesn't exist. -func findProfileBundleFilePath() string { - filePath := getProfileBundleFilePath() - if pathExists(filePath) { - return filePath - } - return "" -} diff --git a/pkg/collector/corechecks/snmp/internal/profile/profile_json_bundle_test.go b/pkg/collector/corechecks/snmp/internal/profile/profile_json_bundle_test.go deleted file mode 100644 index 7ca8bcbbe3172..0000000000000 --- a/pkg/collector/corechecks/snmp/internal/profile/profile_json_bundle_test.go +++ /dev/null @@ -1,59 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2023-present Datadog, Inc. - -package profile - -import ( - "path/filepath" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" -) - -func Test_loadBundleJSONProfiles(t *testing.T) { - defaultTestConfdPath, _ := filepath.Abs(filepath.Join("..", "test", "zipprofiles.d")) - SetGlobalProfileConfigMap(nil) - pkgconfigsetup.Datadog().SetWithoutSource("confd_path", defaultTestConfdPath) - pth := findProfileBundleFilePath() - require.FileExists(t, pth) - resolvedProfiles, err := loadBundleJSONProfiles(pth) - assert.Nil(t, err) - - var actualProfiles []string - var actualMetrics []string - for key, profile := range resolvedProfiles { - actualProfiles = append(actualProfiles, key) - for _, metric := range profile.Definition.Metrics { - actualMetrics = append(actualMetrics, metric.Symbol.Name) - } - } - - expectedProfiles := []string{ - "def-p1", // yaml default profile - "my-profile-name", // downloaded json profile - "profile-from-ui", // downloaded json profile - } - assert.ElementsMatch(t, expectedProfiles, actualProfiles) - - expectedMetrics := []string{ - "metricFromUi2", - "metricFromUi3", - "default_p1_metric", - "default_p1_metric", // from 2 profiles - } - assert.ElementsMatch(t, expectedMetrics, actualMetrics) - - var myProfileMetrics []string - for _, metric := range resolvedProfiles["my-profile-name"].Definition.Metrics { - myProfileMetrics = append(myProfileMetrics, metric.Symbol.Name) - } - expectedMyProfileMetrics := []string{ - "default_p1_metric", - } - assert.ElementsMatch(t, expectedMyProfileMetrics, myProfileMetrics) -} diff --git a/pkg/collector/corechecks/snmp/internal/profile/profile_resolver_test.go b/pkg/collector/corechecks/snmp/internal/profile/profile_resolver_test.go index 1b744b66f38f4..d95c902a7cc3b 100644 --- a/pkg/collector/corechecks/snmp/internal/profile/profile_resolver_test.go +++ b/pkg/collector/corechecks/snmp/internal/profile/profile_resolver_test.go @@ -155,7 +155,7 @@ func Test_resolveProfiles(t *testing.T) { assert.Contains(t, err.Error(), errorMsg) } - w.Flush() + assert.NoError(t, w.Flush()) logs := b.String() for _, aLogCount := range tt.expectedLogs { diff --git a/pkg/collector/corechecks/snmp/internal/profile/profile_test.go b/pkg/collector/corechecks/snmp/internal/profile/profile_test.go index a79103d7e7a49..cb46896c2db7b 100644 --- a/pkg/collector/corechecks/snmp/internal/profile/profile_test.go +++ b/pkg/collector/corechecks/snmp/internal/profile/profile_test.go @@ -17,7 +17,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" ) -func Test_getProfiles(t *testing.T) { +func Test_loadProfiles(t *testing.T) { tests := []struct { name string mockConfd string @@ -74,22 +74,6 @@ func Test_getProfiles(t *testing.T) { }, expectedProfileNames: []string(nil), // invalid profiles are skipped }, - - // json profiles.json.gz profiles - { - name: "OK Use json profiles.json.gz profiles", - mockConfd: "zipprofiles.d", - expectedProfileNames: []string{ - "def-p1", - "my-profile-name", - "profile-from-ui", - }, - }, - { - name: "ERROR Invalid profiles.json.gz profiles", - mockConfd: "zipprofiles_err.d", - expectedErr: "failed to load profiles from json bundle", - }, // yaml profiles { name: "OK Use yaml profiles", @@ -111,7 +95,7 @@ func Test_getProfiles(t *testing.T) { path, _ := filepath.Abs(filepath.Join("..", "test", tt.mockConfd)) pkgconfigsetup.Datadog().SetWithoutSource("confd_path", path) - actualProfiles, err := GetProfiles(tt.profiles) + actualProfiles, err := loadProfiles(tt.profiles) if tt.expectedErr != "" { assert.ErrorContains(t, err, tt.expectedErr) } @@ -373,7 +357,7 @@ func Test_getProfileForSysObjectID(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - profile, err := GetProfileForSysObjectID(tt.profiles, tt.sysObjectID) + profile, err := getProfileForSysObjectID(tt.profiles, tt.sysObjectID) if tt.expectedError == "" { assert.Nil(t, err) } else { diff --git a/pkg/collector/corechecks/snmp/internal/profile/profile_yaml.go b/pkg/collector/corechecks/snmp/internal/profile/profile_yaml.go index 03d7be924a9f3..600809768a026 100644 --- a/pkg/collector/corechecks/snmp/internal/profile/profile_yaml.go +++ b/pkg/collector/corechecks/snmp/internal/profile/profile_yaml.go @@ -23,7 +23,6 @@ import ( const defaultProfilesFolder = "default_profiles" const userProfilesFolder = "profiles" -const profilesJSONGzipFile = "profiles.json.gz" var defaultProfilesMu = &sync.Mutex{} diff --git a/pkg/collector/corechecks/snmp/internal/report/report_device_metadata.go b/pkg/collector/corechecks/snmp/internal/report/report_device_metadata.go index ff8d90912efb3..3e9ad39677d4c 100644 --- a/pkg/collector/corechecks/snmp/internal/report/report_device_metadata.go +++ b/pkg/collector/corechecks/snmp/internal/report/report_device_metadata.go @@ -210,8 +210,9 @@ func buildNetworkDeviceMetadata(deviceID string, idTags []string, config *checkc } // fallback to Device.Vendor for backward compatibility - if config.ProfileDef != nil && vendor == "" { - vendor = config.ProfileDef.Device.Vendor + profileDef := config.GetProfileDef() + if profileDef != nil && vendor == "" { + vendor = profileDef.Device.Vendor } return devicemetadata.DeviceMetadata{ @@ -222,7 +223,7 @@ func buildNetworkDeviceMetadata(deviceID string, idTags []string, config *checkc IPAddress: config.IPAddress, SysObjectID: sysObjectID, Location: location, - Profile: config.Profile, + Profile: config.ProfileName, ProfileVersion: getProfileVersion(config), Vendor: vendor, Tags: tags, @@ -243,8 +244,9 @@ func buildNetworkDeviceMetadata(deviceID string, idTags []string, config *checkc func getProfileVersion(config *checkconfig.CheckConfig) uint64 { var profileVersion uint64 - if config.ProfileDef != nil { - profileVersion = config.ProfileDef.Version + profileDef := config.GetProfileDef() + if profileDef != nil { + profileVersion = profileDef.Version } return profileVersion } diff --git a/pkg/collector/corechecks/snmp/internal/report/report_device_metadata_test.go b/pkg/collector/corechecks/snmp/internal/report/report_device_metadata_test.go index 2cff0364b107f..22d58e9530216 100644 --- a/pkg/collector/corechecks/snmp/internal/report/report_device_metadata_test.go +++ b/pkg/collector/corechecks/snmp/internal/report/report_device_metadata_test.go @@ -61,11 +61,15 @@ func Test_metricSender_reportNetworkDeviceMetadata_withoutInterfaces(t *testing. DeviceIDTags: []string{"device_name:127.0.0.1"}, ResolvedSubnetName: "127.0.0.0/29", Namespace: "my-ns", - Profile: "my-profile", - ProfileDef: &profiledefinition.ProfileDefinition{ - Name: "my-profile", - Version: 10, - }, + ProfileName: "my-profile", + ProfileProvider: profile.StaticProvider(profile.ProfileConfigMap{ + "my-profile": profile.ProfileConfig{ + Definition: profiledefinition.ProfileDefinition{ + Name: "my-profile", + Version: 10, + }, + }, + }), Metadata: profiledefinition.MetadataConfig{ "device": { Fields: map[string]profiledefinition.MetadataField{ @@ -970,10 +974,15 @@ func Test_getProfileVersion(t *testing.T) { { name: "profile definition is present", config: checkconfig.CheckConfig{ - ProfileDef: &profiledefinition.ProfileDefinition{ - Name: "my-profile", - Version: 42, - }, + ProfileName: "my-profile", + ProfileProvider: profile.StaticProvider(profile.ProfileConfigMap{ + "my-profile": profile.ProfileConfig{ + Definition: profiledefinition.ProfileDefinition{ + Name: "my-profile", + Version: 42, + }, + }, + }), }, expectedProfileVersion: 42, }, diff --git a/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/default_profiles/_base.yaml b/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/default_profiles/_base.yaml deleted file mode 100644 index 71e7d7b5bc742..0000000000000 --- a/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/default_profiles/_base.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Base profile that should only contain any items we want to provide for all profiles. - -metric_tags: - - OID: 1.3.6.1.2.1.1.5.0 - symbol: sysName - tag: base_datadog diff --git a/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/default_profiles/def-p1.yaml b/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/default_profiles/def-p1.yaml deleted file mode 100644 index ca814c375fef3..0000000000000 --- a/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/default_profiles/def-p1.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Profile for F5 BIG-IP devices -# -extends: - - _base.yaml - -device: - vendor: "def-p1" - -sysobjectid: 1.2.3.* - -metrics: - - symbol: - OID: 1.2.3.5 - name: default_p1_metric - -# metadata section helps test the bug related to nil metadata -# that is fixed by this PR: https://github.com/DataDog/datadog-agent/pull/20859 -metadata: - device: - fields: - name: - symbol: - OID: 1.3.6.1.2.1.1.5.0 - name: sysName diff --git a/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/profiles/f5-big-ip.yaml b/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/profiles/f5-big-ip.yaml deleted file mode 100644 index 8eead496f206b..0000000000000 --- a/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/profiles/f5-big-ip.yaml +++ /dev/null @@ -1,5 +0,0 @@ - -metric_tags: - - OID: 1.3.6.1.2.1.1.5.0 - symbol: sysName - tag: snmp_host diff --git a/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/profiles/profiles.json.gz b/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/profiles/profiles.json.gz deleted file mode 100644 index f9e134879b4a8..0000000000000 Binary files a/pkg/collector/corechecks/snmp/internal/test/zipprofiles.d/snmp.d/profiles/profiles.json.gz and /dev/null differ diff --git a/pkg/collector/corechecks/snmp/internal/test/zipprofiles_err.d/snmp.d/profiles/profiles.json.gz b/pkg/collector/corechecks/snmp/internal/test/zipprofiles_err.d/snmp.d/profiles/profiles.json.gz deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/pkg/compliance/agent.go b/pkg/compliance/agent.go index 663e7a5f067b6..f839b5a7cb8c1 100644 --- a/pkg/compliance/agent.go +++ b/pkg/compliance/agent.go @@ -23,7 +23,7 @@ import ( "sync" "time" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/compliance/aptconfig" diff --git a/pkg/compliance/dbconfig/loader.go b/pkg/compliance/dbconfig/loader.go index 92c1ad12e978a..d70f673a070ee 100644 --- a/pkg/compliance/dbconfig/loader.go +++ b/pkg/compliance/dbconfig/loader.go @@ -18,7 +18,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/compliance/utils" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" yaml "gopkg.in/yaml.v3" ) diff --git a/pkg/compliance/dbconfig/loader_test.go b/pkg/compliance/dbconfig/loader_test.go index f39ab441ad820..bb2002d96aa81 100644 --- a/pkg/compliance/dbconfig/loader_test.go +++ b/pkg/compliance/dbconfig/loader_test.go @@ -14,7 +14,7 @@ import ( "path/filepath" "testing" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/stretchr/testify/assert" ) diff --git a/pkg/compliance/k8sconfig/loader.go b/pkg/compliance/k8sconfig/loader.go index 3dc23ebde78c2..f58aaec4636b3 100644 --- a/pkg/compliance/k8sconfig/loader.go +++ b/pkg/compliance/k8sconfig/loader.go @@ -25,7 +25,7 @@ import ( "time" "github.com/DataDog/datadog-agent/pkg/compliance/utils" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "gopkg.in/yaml.v3" ) diff --git a/pkg/compliance/resolver.go b/pkg/compliance/resolver.go index 769c5fc91bd16..057cd7a413a3f 100644 --- a/pkg/compliance/resolver.go +++ b/pkg/compliance/resolver.go @@ -32,7 +32,7 @@ import ( docker "github.com/docker/docker/client" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" yamlv2 "gopkg.in/yaml.v2" yamlv3 "gopkg.in/yaml.v3" diff --git a/pkg/config/env/go.mod b/pkg/config/env/go.mod index c98d3f9e2d11e..34b158b27e106 100644 --- a/pkg/config/env/go.mod +++ b/pkg/config/env/go.mod @@ -23,10 +23,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -37,7 +38,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/config/env/go.sum b/pkg/config/env/go.sum index b7b383aee36ed..55897bd029c82 100644 --- a/pkg/config/env/go.sum +++ b/pkg/config/env/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -34,6 +34,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -146,8 +148,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/config/mock/go.mod b/pkg/config/mock/go.mod index e526a9aa1d0ee..a358e04841b8b 100644 --- a/pkg/config/mock/go.mod +++ b/pkg/config/mock/go.mod @@ -53,10 +53,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -69,8 +70,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/config/mock/go.sum b/pkg/config/mock/go.sum index b60bbee1b243d..6df24d44986c1 100644 --- a/pkg/config/mock/go.sum +++ b/pkg/config/mock/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/config/model/go.mod b/pkg/config/model/go.mod index 7f648a0c2076c..4fb2df929ebac 100644 --- a/pkg/config/model/go.mod +++ b/pkg/config/model/go.mod @@ -11,7 +11,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 - github.com/DataDog/viper v1.13.5 + github.com/DataDog/viper v1.14.0 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/stretchr/testify v1.10.0 golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f diff --git a/pkg/config/model/go.sum b/pkg/config/model/go.sum index ddbfab1c363b2..7b03b89cac861 100644 --- a/pkg/config/model/go.sum +++ b/pkg/config/model/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/pkg/config/nodetreemodel/config.go b/pkg/config/nodetreemodel/config.go index e2f6c4b8f7139..e9854f1db99d1 100644 --- a/pkg/config/nodetreemodel/config.go +++ b/pkg/config/nodetreemodel/config.go @@ -128,12 +128,6 @@ type NodeTreeConfig interface { GetNode(string) (Node, error) } -func (c *ntmConfig) logErrorNotImplemented(method string) error { - err := fmt.Errorf("not implemented: %s", method) - log.Error(err) - return err -} - // OnUpdate adds a callback to the list of receivers to be called each time a value is changed in the configuration // by a call to the 'Set' method. // Callbacks are only called if the value is effectively changed. @@ -634,7 +628,7 @@ func (c *ntmConfig) MergeConfig(in io.Reader) error { } other := newInnerNode(nil) - if err = c.readConfigurationContent(other, content); err != nil { + if err = c.readConfigurationContent(other, model.SourceFile, content); err != nil { return err } @@ -663,8 +657,17 @@ func (c *ntmConfig) MergeFleetPolicy(configPath string) error { } defer in.Close() - // TODO: Implement merging, merge in the policy that was read - return c.logErrorNotImplemented("MergeFleetPolicy") + content, err := io.ReadAll(in) + if err != nil { + return err + } + + other := newInnerNode(nil) + if err = c.readConfigurationContent(other, model.SourceFleetPolicies, content); err != nil { + return err + } + + return c.root.Merge(other) } // AllSettings returns all settings from the config diff --git a/pkg/config/nodetreemodel/config_test.go b/pkg/config/nodetreemodel/config_test.go index 4738b4e446767..0fbac128999c9 100644 --- a/pkg/config/nodetreemodel/config_test.go +++ b/pkg/config/nodetreemodel/config_test.go @@ -575,3 +575,20 @@ func TestUnsetForSource(t *testing.T) { val:4, source:default` assert.Equal(t, expect, txt) } + +func TestMergeFleetPolicy(t *testing.T) { + config := NewConfig("test", "TEST", strings.NewReplacer(".", "_")) // nolint: forbidigo + config.SetConfigType("yaml") + config.SetDefault("foo", "") + config.BuildSchema() + config.Set("foo", "bar", model.SourceFile) + + file, err := os.CreateTemp("", "datadog.yaml") + assert.NoError(t, err, "failed to create temporary file: %w", err) + file.Write([]byte("foo: baz")) + err = config.MergeFleetPolicy(file.Name()) + assert.NoError(t, err) + + assert.Equal(t, "baz", config.Get("foo")) + assert.Equal(t, model.SourceFleetPolicies, config.GetSource("foo")) +} diff --git a/pkg/config/nodetreemodel/go.mod b/pkg/config/nodetreemodel/go.mod index fddf0197843dc..de9da422721ad 100644 --- a/pkg/config/nodetreemodel/go.mod +++ b/pkg/config/nodetreemodel/go.mod @@ -14,7 +14,7 @@ replace github.com/spf13/cast => github.com/DataDog/cast v1.8.0 require ( github.com/DataDog/datadog-agent/pkg/config/model v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 - github.com/DataDog/viper v1.13.5 + github.com/DataDog/viper v1.14.0 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/spf13/cast v1.7.0 github.com/stretchr/testify v1.10.0 diff --git a/pkg/config/nodetreemodel/go.sum b/pkg/config/nodetreemodel/go.sum index e896db4ce9103..ebb19c16de189 100644 --- a/pkg/config/nodetreemodel/go.sum +++ b/pkg/config/nodetreemodel/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/cast v1.8.0 h1:uooY8bMzq+cjgiNP1VTquCWve5emgk8fRspZojJwQa8= github.com/DataDog/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/pkg/config/nodetreemodel/read_config_file.go b/pkg/config/nodetreemodel/read_config_file.go index 8354a012376b0..e006d188ea794 100644 --- a/pkg/config/nodetreemodel/read_config_file.go +++ b/pkg/config/nodetreemodel/read_config_file.go @@ -67,7 +67,7 @@ func (c *ntmConfig) ReadConfig(in io.Reader) error { if err != nil { return err } - if err := c.readConfigurationContent(c.file, content); err != nil { + if err := c.readConfigurationContent(c.file, model.SourceFile, content); err != nil { return err } return c.mergeAllLayers() @@ -78,19 +78,19 @@ func (c *ntmConfig) readInConfig(filePath string) error { if err != nil { return err } - return c.readConfigurationContent(c.file, content) + return c.readConfigurationContent(c.file, model.SourceFile, content) } -func (c *ntmConfig) readConfigurationContent(target InnerNode, content []byte) error { - var obj map[string]interface{} +func (c *ntmConfig) readConfigurationContent(target InnerNode, source model.Source, content []byte) error { + var inData map[string]interface{} - if strictErr := yaml.UnmarshalStrict(content, &obj); strictErr != nil { + if strictErr := yaml.UnmarshalStrict(content, &inData); strictErr != nil { log.Errorf("warning reading config file: %v\n", strictErr) - if err := yaml.Unmarshal(content, &obj); err != nil { + if err := yaml.Unmarshal(content, &inData); err != nil { return err } } - c.warnings = append(c.warnings, loadYamlInto(c.schema, target, obj, "")...) + c.warnings = append(c.warnings, loadYamlInto(target, source, inData, "", c.schema)...) return nil } @@ -119,64 +119,56 @@ func toMapStringInterface(data any, path string) (map[string]interface{}, error) return nil, fmt.Errorf("invalid type from configuration for key '%s'", path) } -// loadYamlInto fetch the value for known setings and set them in a tree. The function returns a list of warning about -// unknown settings or invalid types from the YAML. -// -// The function traverses a object loaded from YAML, checking if each node is known within the configuration. -// If known, the value from the YAML blob is imported into the 'dest' tree. If unknown, a warning will be created. -func loadYamlInto(schema InnerNode, dest InnerNode, data map[string]interface{}, path string) []string { - if path != "" { - path = path + "." - } - +// loadYamlInto traverses input data parsed from YAML, checking if each node is defined by the schema. +// If found, the value from the YAML blob is imported into the 'dest' tree. Otherwise, a warning will be created. +func loadYamlInto(dest InnerNode, source model.Source, inData map[string]interface{}, atPath string, schema InnerNode) []string { warnings := []string{} - for key, value := range data { + for key, value := range inData { key = strings.ToLower(key) - curPath := path + key + currPath := joinKey(atPath, key) - // check if the key is know in the schema - schemaNode, err := schema.GetChild(key) + // check if the key is defined in the schema + schemaChild, err := schema.GetChild(key) if err != nil { - warnings = append(warnings, fmt.Sprintf("unknown key from YAML: %s", curPath)) + warnings = append(warnings, fmt.Sprintf("unknown key from YAML: %s", currPath)) continue } - // if the default is a leaf we create a new leaf in dest - if _, isLeaf := schemaNode.(LeafNode); isLeaf { - // check that dest don't have a inner leaf under that name + // if the node in the schema is a leaf, then we create a new leaf in dest + if _, isLeaf := schemaChild.(LeafNode); isLeaf { + // check that dest doesn't have a inner leaf under that name c, _ := dest.GetChild(key) if _, ok := c.(InnerNode); ok { // Both default and dest have a child but they conflict in type. This should never happen. warnings = append(warnings, "invalid tree: default and dest tree don't have the same layout") } else { - dest.InsertChildNode(key, newLeafNode(value, model.SourceFile)) + dest.InsertChildNode(key, newLeafNode(value, source)) } continue } + // by now we know schemaNode is an InnerNode + schemaInner, _ := schemaChild.(InnerNode) - mapString, err := toMapStringInterface(value, curPath) + childValue, err := toMapStringInterface(value, currPath) if err != nil { warnings = append(warnings, err.Error()) } - // by now we know schemaNode is an InnerNode - defaultNext, _ := schemaNode.(InnerNode) - if !dest.HasChild(key) { - destInner := newInnerNode(nil) - warnings = append(warnings, loadYamlInto(defaultNext, destInner, mapString, curPath)...) - dest.InsertChildNode(key, destInner) + destChildInner := newInnerNode(nil) + warnings = append(warnings, loadYamlInto(destChildInner, source, childValue, currPath, schemaInner)...) + dest.InsertChildNode(key, destChildInner) continue } - child, _ := dest.GetChild(key) - destChildInner, ok := child.(InnerNode) + destChild, _ := dest.GetChild(key) + destChildInner, ok := destChild.(InnerNode) if !ok { // Both default and dest have a child but they conflict in type. This should never happen. warnings = append(warnings, "invalid tree: default and dest tree don't have the same layout") continue } - warnings = append(warnings, loadYamlInto(defaultNext, destChildInner, mapString, curPath)...) + warnings = append(warnings, loadYamlInto(destChildInner, source, childValue, currPath, schemaInner)...) } return warnings } diff --git a/pkg/config/remote/go.mod b/pkg/config/remote/go.mod index 7442b0348731d..418e2f017f81d 100644 --- a/pkg/config/remote/go.mod +++ b/pkg/config/remote/go.mod @@ -108,8 +108,7 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/ryanuber/go-glob v1.0.0 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect @@ -123,7 +122,7 @@ require ( require ( github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect diff --git a/pkg/config/remote/go.sum b/pkg/config/remote/go.sum index a5c2739769aa2..fa403bade18cb 100644 --- a/pkg/config/remote/go.sum +++ b/pkg/config/remote/go.sum @@ -19,8 +19,8 @@ github.com/DataDog/gostackparse v0.7.0 h1:i7dLkXHvYzHV308hnkvVGDL3BR4FWl7IsXNPz/ github.com/DataDog/gostackparse v0.7.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -255,12 +255,8 @@ github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkB github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= diff --git a/pkg/config/setup/go.mod b/pkg/config/setup/go.mod index 1813f0c12bcbd..c02d710d51f13 100644 --- a/pkg/config/setup/go.mod +++ b/pkg/config/setup/go.mod @@ -63,12 +63,13 @@ require ( github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -87,8 +88,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/config/setup/go.sum b/pkg/config/setup/go.sum index a67414c323f7c..18e09a82750bb 100644 --- a/pkg/config/setup/go.sum +++ b/pkg/config/setup/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/cast v1.8.0 h1:uooY8bMzq+cjgiNP1VTquCWve5emgk8fRspZojJwQa8= github.com/DataDog/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -43,6 +43,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -177,12 +179,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/config/structure/go.mod b/pkg/config/structure/go.mod index 6f87e72960ea6..83c57b35c79fd 100644 --- a/pkg/config/structure/go.mod +++ b/pkg/config/structure/go.mod @@ -36,7 +36,7 @@ replace github.com/spf13/cast => github.com/DataDog/cast v1.8.0 require ( github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 - github.com/DataDog/viper v1.13.5 + github.com/DataDog/viper v1.14.0 github.com/spf13/cast v1.7.0 github.com/stretchr/testify v1.10.0 ) diff --git a/pkg/config/structure/go.sum b/pkg/config/structure/go.sum index e896db4ce9103..ebb19c16de189 100644 --- a/pkg/config/structure/go.sum +++ b/pkg/config/structure/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/cast v1.8.0 h1:uooY8bMzq+cjgiNP1VTquCWve5emgk8fRspZojJwQa8= github.com/DataDog/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/pkg/config/teeconfig/go.mod b/pkg/config/teeconfig/go.mod index c65facf0b1e58..7644391c8d1bf 100644 --- a/pkg/config/teeconfig/go.mod +++ b/pkg/config/teeconfig/go.mod @@ -11,7 +11,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/config/model v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 - github.com/DataDog/viper v1.13.5 + github.com/DataDog/viper v1.14.0 ) require ( diff --git a/pkg/config/teeconfig/go.sum b/pkg/config/teeconfig/go.sum index ddbfab1c363b2..7b03b89cac861 100644 --- a/pkg/config/teeconfig/go.sum +++ b/pkg/config/teeconfig/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/pkg/config/utils/go.mod b/pkg/config/utils/go.mod index c27cbcf9b59f8..d8f776a5d5ebd 100644 --- a/pkg/config/utils/go.mod +++ b/pkg/config/utils/go.mod @@ -58,10 +58,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -74,8 +75,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/config/utils/go.sum b/pkg/config/utils/go.sum index b60bbee1b243d..6df24d44986c1 100644 --- a/pkg/config/utils/go.sum +++ b/pkg/config/utils/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/fleet/installer/packages/datadog_agent.go b/pkg/fleet/installer/packages/datadog_agent.go index 7236096bbf1e1..2b7d4192d4592 100644 --- a/pkg/fleet/installer/packages/datadog_agent.go +++ b/pkg/fleet/installer/packages/datadog_agent.go @@ -104,7 +104,7 @@ func SetupAgent(ctx context.Context, _ []string) (err error) { if err = os.MkdirAll("/etc/datadog-agent", 0755); err != nil { return fmt.Errorf("failed to create /etc/datadog-agent: %v", err) } - ddAgentUID, ddAgentGID, err := GetAgentIDs() + ddAgentUID, ddAgentGID, err := getAgentIDs() if err != nil { return fmt.Errorf("error getting dd-agent user and group IDs: %w", err) } @@ -230,7 +230,7 @@ func chownRecursive(path string, uid int, gid int, ignorePaths []string) error { // StartAgentExperiment starts the agent experiment func StartAgentExperiment(ctx context.Context) error { - ddAgentUID, ddAgentGID, err := GetAgentIDs() + ddAgentUID, ddAgentGID, err := getAgentIDs() if err != nil { return fmt.Errorf("error getting dd-agent user and group IDs: %w", err) } diff --git a/pkg/fleet/installer/packages/datadog_installer.go b/pkg/fleet/installer/packages/datadog_installer.go index ceaf08bf330d6..14d0f042cd0e6 100644 --- a/pkg/fleet/installer/packages/datadog_installer.go +++ b/pkg/fleet/installer/packages/datadog_installer.go @@ -60,7 +60,7 @@ func SetupInstaller(ctx context.Context) (err error) { if err != nil { return fmt.Errorf("error adding dd-agent user to dd-agent group: %w", err) } - ddAgentUID, ddAgentGID, err := GetAgentIDs() + ddAgentUID, ddAgentGID, err := getAgentIDs() if err != nil { return fmt.Errorf("error getting dd-agent user and group IDs: %w", err) } @@ -165,8 +165,8 @@ func SetupInstaller(ctx context.Context) (err error) { return startInstallerStable(ctx) } -// GetAgentIDs returns the UID and GID of the dd-agent user and group. -func GetAgentIDs() (uid, gid int, err error) { +// getAgentIDs returns the UID and GID of the dd-agent user and group. +func getAgentIDs() (uid, gid int, err error) { ddAgentUser, err := user.Lookup("dd-agent") if err != nil { return -1, -1, fmt.Errorf("dd-agent user not found: %w", err) diff --git a/pkg/fleet/installer/packages/docker.go b/pkg/fleet/installer/packages/docker.go index 8c19fc04a4ec8..45984ca96a652 100644 --- a/pkg/fleet/installer/packages/docker.go +++ b/pkg/fleet/installer/packages/docker.go @@ -21,7 +21,7 @@ import ( "time" "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) diff --git a/pkg/fleet/installer/setup/common/config.go b/pkg/fleet/installer/setup/common/config.go index 865b617c6283a..fb1677aeb6964 100644 --- a/pkg/fleet/installer/setup/common/config.go +++ b/pkg/fleet/installer/setup/common/config.go @@ -3,242 +3,211 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build !windows - -// Package common contains the HostInstaller struct which is used to write the agent agentConfiguration to disk package common import ( - "context" "fmt" "os" "path/filepath" - "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" - "github.com/DataDog/datadog-agent/pkg/fleet/installer/oci" - "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages" - "github.com/DataDog/datadog-agent/pkg/fleet/internal/exec" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" ) -var ( +const ( + disclaimerGenerated = `# This file was generated by the Datadog Installer. +# Other configuration options are available, see https://docs.datadoghq.com/agent/guide/agent-configuration-files/ for more information.` + configDir = "/etc/datadog-agent" - datadogConfFile = filepath.Join(configDir, "datadog.yaml") - logsConfFile = filepath.Join(configDir, "conf.d/configured_at_install_logs.yaml") - sparkConfigFile = filepath.Join(configDir, "conf.d/spark.d/spark.yaml") - injectTracerConfigFile = filepath.Join(configDir, "inject/tracer.yaml") + datadogConfFile = "datadog.yaml" + injectTracerConfigFile = "inject/tracer.yaml" ) -// HostInstaller is a struct that represents the agent agentConfiguration -// used to write the agentConfiguration to disk in datadog-installer custom setup scenarios -type HostInstaller struct { - env *env.Env - - agentConfig map[string]interface{} - logsConfig logsConfig - sparkConfig sparkConfig - injectorConfig injectorConfig - hostTags []tag - ddUID int - ddGID int - - injectorVersion string - javaVersion string - agentVersion string -} - -type tag struct { - key string `yaml:"key"` - value string `yaml:"value"` -} - -type logsConfig struct { - Logs []LogConfig `yaml:"logs"` -} - -// LogConfig is a struct that represents a single log agentConfiguration -type LogConfig struct { - Type string `yaml:"type"` - Path string `yaml:"path"` - Service string `yaml:"service,omitempty"` - Source string `yaml:"source,omitempty"` -} - -type sparkConfig struct { - InitConfig interface{} `yaml:"init_config,omitempty"` - Instances []SparkInstance `yaml:"instances"` -} - -// SparkInstance is a struct that represents a single spark instance -type SparkInstance struct { - SparkURL string `yaml:"spark_url"` - SparkClusterMode string `yaml:"spark_cluster_mode,omitempty"` - ClusterName string `yaml:"cluster_name"` - StreamingMetrics bool `yaml:"streaming_metrics,omitempty"` -} - -type injectorConfig struct { - Version int `yaml:"version"` - ConfigSources string `yaml:"config_sources"` - EnvsToInject []EnvVar `yaml:"additional_environment_variables"` -} - -// EnvVar is a struct that represents an environment variable -type EnvVar struct { - Key string `yaml:"key"` - Value string `yaml:"value"` -} - -// NewHostInstaller creates a new HostInstaller struct and loads the existing agentConfiguration from disk -func NewHostInstaller(env *env.Env) (*HostInstaller, error) { - ddUID, ddGID, err := packages.GetAgentIDs() +func writeConfigs(config Config, configDir string) error { + err := writeConfig(filepath.Join(configDir, datadogConfFile), config.DatadogYAML, 0640, true) if err != nil { - return nil, fmt.Errorf("failed to get agent user and group IDs: %v", err) + return fmt.Errorf("could not write datadog.yaml: %w", err) } - return newHostInstaller(env, ddUID, ddGID) + err = writeConfig(filepath.Join(configDir, injectTracerConfigFile), config.InjectTracerYAML, 0644, false) + if err != nil { + return fmt.Errorf("could not write tracer.yaml: %w", err) + } + for name, config := range config.IntegrationConfigs { + err = writeConfig(filepath.Join(configDir, "conf.d", name), config, 0644, false) + if err != nil { + return fmt.Errorf("could not write %s.yaml: %w", name, err) + } + } + return nil } -func newHostInstaller(env *env.Env, ddUID, ddGID int) (*HostInstaller, error) { - i := &HostInstaller{agentConfig: make(map[string]interface{})} - if env.APIKey == "" { - return nil, fmt.Errorf("DD_API key is required") +func writeConfig(path string, config any, perms os.FileMode, merge bool) error { + serializedNewConfig, err := yaml.Marshal(config) + if err != nil { + return fmt.Errorf("could not serialize config: %w", err) } - i.AddAgentConfig("api_key", env.APIKey) - - if env.Site != "" { - i.AddAgentConfig("site", env.Site) + var newConfig map[string]interface{} + err = yaml.Unmarshal(serializedNewConfig, &newConfig) + if err != nil { + return fmt.Errorf("could not unmarshal config: %w", err) + } + if len(newConfig) == 0 { + return nil + } + err = os.MkdirAll(filepath.Dir(path), 0755) + if err != nil { + return fmt.Errorf("could not create config directory: %w", err) } - i.ddUID = ddUID - i.ddGID = ddGID - i.env = env - return i, nil + var existingConfig map[string]interface{} + if merge { + serializedExistingConfig, err := os.ReadFile(path) + if err != nil && !os.IsNotExist(err) { + return fmt.Errorf("could not read existing config: %w", err) + } + if err == nil { + err = yaml.Unmarshal(serializedExistingConfig, &existingConfig) + if err != nil { + return fmt.Errorf("could not unmarshal existing config: %w", err) + } + } + } + merged, err := mergeConfig(existingConfig, newConfig) + if err != nil { + return fmt.Errorf("could not merge config: %w", err) + } + serializedMerged, err := yaml.Marshal(merged) + if err != nil { + return fmt.Errorf("could not serialize merged config: %w", err) + } + if len(existingConfig) == 0 { + serializedMerged = []byte(disclaimerGenerated + "\n\n" + string(serializedMerged)) + } + err = os.WriteFile(path, serializedMerged, perms) + if err != nil { + return fmt.Errorf("could not write config: %w", err) + } + return nil } -// SetAgentVersion sets the agent version to install -func (i *HostInstaller) SetAgentVersion(version string) { - i.agentVersion = version +// Config represents the configuration to write in /etc/datadog-agent +type Config struct { + // DatadogYAML is the content of the datadog.yaml file + DatadogYAML DatadogConfig + // InjectTracerYAML is the content of the inject/tracer.yaml file + InjectTracerYAML InjectTracerConfig + // IntegrationConfigs is the content of the integration configuration files under conf.d/ + IntegrationConfigs map[string]IntegrationConfig } -// SetInjectorVersion sets the injector version to install -func (i *HostInstaller) SetInjectorVersion(version string) { - i.injectorVersion = version +// DatadogConfig represents the configuration to write in /etc/datadog-agent/datadog.yaml +type DatadogConfig struct { + APIKey string `yaml:"api_key"` + Hostname string `yaml:"hostname,omitempty"` + Site string `yaml:"site,omitempty"` + Env string `yaml:"env,omitempty"` + Tags []string `yaml:"tags,omitempty"` + LogsEnabled bool `yaml:"logs_enabled,omitempty"` + DJM DatadogConfigDJM `yaml:"djm,omitempty"` + ProcessConfig DatadogConfigProcessConfig `yaml:"process_config,omitempty"` + ExpectedTagsDuration string `yaml:"expected_tags_duration,omitempty"` } -// SetJavaTracerVersion sets the java tracer version to install -func (i *HostInstaller) SetJavaTracerVersion(version string) { - i.javaVersion = version +// DatadogConfigDJM represents the configuration for the Data Jobs Monitoring +type DatadogConfigDJM struct { + Enabled bool `yaml:"enabled,omitempty"` } -// AddTracerEnv adds an environment variable to the list of environment variables to inject -func (i *HostInstaller) AddTracerEnv(key, value string) { - i.injectorConfig.EnvsToInject = append(i.injectorConfig.EnvsToInject, EnvVar{Key: key, Value: value}) +// DatadogConfigProcessConfig represents the configuration for the process agent +type DatadogConfigProcessConfig struct { + ExpvarPort int `yaml:"expvar_port,omitempty"` } -// AddAgentConfig adds a key value pair to the agent agentConfiguration -func (i *HostInstaller) AddAgentConfig(key string, value interface{}) { - i.agentConfig[key] = value +// IntegrationConfig represents the configuration for an integration under conf.d/ +type IntegrationConfig struct { + InitConfig []any `yaml:"init_config,omitempty"` + Instances []any `yaml:"instances,omitempty"` + Logs []IntegrationConfigLogs `yaml:"logs,omitempty"` } -// AddLogConfig adds a log agentConfiguration to the agent configuration -func (i *HostInstaller) AddLogConfig(log LogConfig) { - i.logsConfig.Logs = append(i.logsConfig.Logs, log) - if len(i.logsConfig.Logs) == 1 { - i.AddAgentConfig("logs_enabled", true) - } +// IntegrationConfigLogs represents the configuration for the logs of an integration +type IntegrationConfigLogs struct { + Type string `yaml:"type,omitempty"` + Path string `yaml:"path,omitempty"` + Service string `yaml:"service,omitempty"` + Source string `yaml:"source,omitempty"` } -// AddSparkInstance adds a spark instance to the agent agentConfiguration -func (i *HostInstaller) AddSparkInstance(spark SparkInstance) { - i.sparkConfig.Instances = append(i.sparkConfig.Instances, spark) +// IntegrationConfigInstanceSpark represents the configuration for the Spark integration +type IntegrationConfigInstanceSpark struct { + SparkURL string `yaml:"spark_url"` + SparkClusterMode string `yaml:"spark_cluster_mode"` + ClusterName string `yaml:"cluster_name"` + StreamingMetrics bool `yaml:"streaming_metrics"` } -// AddHostTag adds a host tag to the agent agentConfiguration -func (i *HostInstaller) AddHostTag(key, value string) { - i.hostTags = append(i.hostTags, tag{key, value}) +// InjectTracerConfig represents the configuration to write in /etc/datadog-agent/inject/tracer.yaml +type InjectTracerConfig struct { + Version int `yaml:"version,omitempty"` + ConfigSources string `yaml:"config_sources,omitempty"` + AdditionalEnvironmentVariables []InjectTracerConfigEnvVar `yaml:"additional_environment_variables,omitempty"` } -func (i *HostInstaller) writeYamlConfig(path string, yml interface{}, perm os.FileMode, agentOwner bool) error { - data, err := yaml.Marshal(yml) - if err != nil { - return err +// InjectTracerConfigEnvVar represents an environment variable to inject +type InjectTracerConfigEnvVar struct { + Key string `yaml:"key"` + Value string `yaml:"value"` +} + +// mergeConfig merges the current config with the setup config. +// +// The values are merged as follows: +// - Scalars: the override value is used +// - Lists: the override list is used +// - Maps: the override map is recursively merged into the base map +func mergeConfig(base interface{}, override interface{}) (interface{}, error) { + if base == nil { + return override, nil } - dir := filepath.Dir(path) - if err := os.MkdirAll(dir, 0755); err != nil { - return fmt.Errorf("failed to create directory %s: %v", dir, err) + if override == nil { + // this allows to override a value with nil + return nil, nil } - if err = os.WriteFile(path, data, perm); err != nil { - return fmt.Errorf("failed to write to %s: %v", path, err) + if isScalar(base) && isScalar(override) { + return override, nil } - // Change ownership of the file to the agent user - // ddUID=0 happens in local test environments - if agentOwner && i.ddUID != 0 { - if err := os.Chown(path, i.ddUID, i.ddGID); err != nil { - return fmt.Errorf("failed to change ownership of %s: %v", path, err) - } + if isList(base) && isList(override) { + return override, nil } - return nil -} - -func convertTagsToYaml(tags []tag) []interface{} { - result := make([]interface{}, 0, len(tags)) - for _, tag := range tags { - result = append(result, fmt.Sprintf("%s:%s", tag.key, tag.value)) + if isMap(base) && isMap(override) { + return mergeMap(base.(map[string]interface{}), override.(map[string]interface{})) } - return result + return nil, fmt.Errorf("could not merge %T with %T", base, override) } -func (i *HostInstaller) writeConfigs() error { - if len(i.hostTags) > 0 { - i.AddAgentConfig("tags", convertTagsToYaml(i.hostTags)) - } - - if err := i.writeYamlConfig(datadogConfFile, i.agentConfig, 0640, true); err != nil { - return err - } - if len(i.logsConfig.Logs) > 0 { - if err := i.writeYamlConfig(logsConfFile, i.logsConfig, 0644, true); err != nil { - return err - } +func mergeMap(base, override map[string]interface{}) (map[string]interface{}, error) { + merged := make(map[string]interface{}) + for k, v := range base { + merged[k] = v } - if len(i.sparkConfig.Instances) > 0 { - if err := i.writeYamlConfig(sparkConfigFile, i.sparkConfig, 0644, true); err != nil { - return err + for k := range override { + v, err := mergeConfig(base[k], override[k]) + if err != nil { + return nil, fmt.Errorf("could not merge key %v: %w", k, err) } + merged[k] = v } - if len(i.injectorConfig.EnvsToInject) > 0 { - if err := i.writeYamlConfig(injectTracerConfigFile, i.injectorConfig, 0644, false); err != nil { - return err - } - } - return nil + return merged, nil } -// ConfigureAndInstall writes configurations to disk and installs desired packages -func (i *HostInstaller) ConfigureAndInstall(ctx context.Context) error { - if err := i.writeConfigs(); err != nil { - return fmt.Errorf("failed to write configurations: %w", err) - } +func isList(i interface{}) bool { + _, ok := i.([]interface{}) + return ok +} - exePath, err := os.Executable() - if err != nil { - return fmt.Errorf("failed to get executable path: %w", err) - } - cmd := exec.NewInstallerExec(i.env, exePath) +func isMap(i interface{}) bool { + _, ok := i.(map[string]interface{}) + return ok +} - if i.injectorVersion != "" { - if err := cmd.Install(ctx, oci.PackageURL(i.env, "datadog-apm-inject", i.injectorVersion), nil); err != nil { - return fmt.Errorf("failed to install injector: %w", err) - } - } - if i.javaVersion != "" { - if err := cmd.Install(ctx, oci.PackageURL(i.env, "datadog-apm-library-java", i.javaVersion), nil); err != nil { - return fmt.Errorf("failed to install java library: %w", err) - } - } - if i.agentVersion != "" { - if err := cmd.Install(ctx, oci.PackageURL(i.env, "datadog-agent", i.agentVersion), nil); err != nil { - return fmt.Errorf("failed to install Databricks agent: %w", err) - } - } - return nil +func isScalar(i interface{}) bool { + return !isList(i) && !isMap(i) } diff --git a/pkg/fleet/installer/setup/common/config_test.go b/pkg/fleet/installer/setup/common/config_test.go index bfe2809f39087..7c02cd3999e02 100644 --- a/pkg/fleet/installer/setup/common/config_test.go +++ b/pkg/fleet/installer/setup/common/config_test.go @@ -5,7 +5,6 @@ //go:build !windows -// Package common contains the HostInstaller struct which is used to write the agent agentConfiguration to disk package common import ( @@ -14,48 +13,155 @@ import ( "testing" "github.com/stretchr/testify/assert" - - "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" + "gopkg.in/yaml.v3" ) -func assertFileContent(t *testing.T, file, content string) { - b, err := os.ReadFile(file) +func TestEmptyConfig(t *testing.T) { + tempDir := t.TempDir() + config := Config{} + config.DatadogYAML.APIKey = "1234567890" // Required field + + err := writeConfigs(config, tempDir) + assert.NoError(t, err) + + // Check datadog.yaml + datadogConfigPath := filepath.Join(tempDir, datadogConfFile) + info, err := os.Stat(datadogConfigPath) + assert.NoError(t, err) + assert.Equal(t, os.FileMode(0640), info.Mode()) + datadogYAML, err := os.ReadFile(datadogConfigPath) + assert.NoError(t, err) + var datadog map[string]interface{} + err = yaml.Unmarshal(datadogYAML, &datadog) + assert.NoError(t, err) + assert.Equal(t, map[string]interface{}{"api_key": "1234567890"}, datadog) + + // Assert no other files are created + dir, err := os.ReadDir(tempDir) + assert.NoError(t, err) + assert.Len(t, dir, 1) +} + +func TestMergeConfig(t *testing.T) { + tempDir := t.TempDir() + oldConfig := `--- +api_key: "0987654321" +hostname: "old_hostname" +env: "old_env" +` + err := os.WriteFile(filepath.Join(tempDir, datadogConfFile), []byte(oldConfig), 0644) + assert.NoError(t, err) + config := Config{} + config.DatadogYAML.APIKey = "1234567890" // Required field + config.DatadogYAML.Hostname = "new_hostname" + config.DatadogYAML.LogsEnabled = true + + err = writeConfigs(config, tempDir) + assert.NoError(t, err) + + // Check datadog.yaml + datadogConfigPath := filepath.Join(tempDir, datadogConfFile) + datadogYAML, err := os.ReadFile(datadogConfigPath) + assert.NoError(t, err) + var datadog map[string]interface{} + err = yaml.Unmarshal(datadogYAML, &datadog) + assert.NoError(t, err) + assert.Equal(t, map[string]interface{}{ + "api_key": "1234567890", + "hostname": "new_hostname", + "env": "old_env", + "logs_enabled": true, + }, datadog) +} + +func TestInjectTracerConfig(t *testing.T) { + tempDir := t.TempDir() + config := Config{} + config.InjectTracerYAML = InjectTracerConfig{ + Version: 1, + ConfigSources: "env", + AdditionalEnvironmentVariables: []InjectTracerConfigEnvVar{ + { + Key: "DD_ENV", + Value: "prod", + }, + }, + } + + err := writeConfigs(config, tempDir) + assert.NoError(t, err) + + // Check inject/tracer.yaml + injectTracerConfigPath := filepath.Join(tempDir, injectTracerConfigFile) + assert.FileExists(t, injectTracerConfigPath) + injectTracerYAML, err := os.ReadFile(injectTracerConfigPath) + assert.NoError(t, err) + var injectTracer map[string]interface{} + err = yaml.Unmarshal(injectTracerYAML, &injectTracer) assert.NoError(t, err) - assert.Equal(t, content, string(b)) + assert.Equal(t, map[string]interface{}{ + "version": 1, + "config_sources": "env", + "additional_environment_variables": []interface{}{ + map[string]interface{}{ + "key": "DD_ENV", + "value": "prod", + }, + }, + }, injectTracer) } -func TestAgentConfigs(t *testing.T) { - configDir = t.TempDir() - datadogConfFile = filepath.Join(configDir, "datadog.yaml") - logsConfFile = filepath.Join(configDir, "conf.d/configured_at_install_logs.yaml") - sparkConfigFile = filepath.Join(configDir, "conf.d/spark.d/spark.yaml") - - i, err := newHostInstaller(&env.Env{APIKey: "a"}, 0, 0) - assert.NotNil(t, i) - assert.Nil(t, err) - - i.AddAgentConfig("key", "value") - i.AddLogConfig(LogConfig{Type: "file", Path: "/var/log/app.log", Service: "app"}) - i.AddHostTag("k1", "v1") - i.AddHostTag("k2", "v2") - i.AddSparkInstance(SparkInstance{ClusterName: "cluster", SparkURL: "http://localhost:8080"}) - - assert.NoError(t, i.writeConfigs()) - assertFileContent(t, datadogConfFile, `api_key: a -key: value -logs_enabled: true -tags: -- k1:v1 -- k2:v2 -`) - - assertFileContent(t, logsConfFile, `logs: -- type: file - path: /var/log/app.log - service: app -`) - assertFileContent(t, sparkConfigFile, `instances: -- spark_url: http://localhost:8080 - cluster_name: cluster -`) +func TestIntegrationConfigInstanceSpark(t *testing.T) { + tempDir := t.TempDir() + config := Config{ + IntegrationConfigs: make(map[string]IntegrationConfig), + } + config.IntegrationConfigs["spark.d/kebabricks.yaml"] = IntegrationConfig{ + Logs: []IntegrationConfigLogs{ + { + Type: "file", + Path: "/databricks/spark/work/*/*/stderr", + Source: "worker_stderr", + Service: "databricks", + }, + }, + Instances: []any{ + IntegrationConfigInstanceSpark{ + SparkURL: "http://localhost:4040", + SparkClusterMode: "spark_driver_mode", + ClusterName: "big-kebab-data", + StreamingMetrics: true, + }, + }, + } + + err := writeConfigs(config, tempDir) + assert.NoError(t, err) + + // Check spark.d/kebabricks.yaml + sparkConfigPath := filepath.Join(tempDir, "conf.d", "spark.d", "kebabricks.yaml") + assert.FileExists(t, sparkConfigPath) + sparkYAML, err := os.ReadFile(sparkConfigPath) + assert.NoError(t, err) + var spark map[string]interface{} + err = yaml.Unmarshal(sparkYAML, &spark) + assert.NoError(t, err) + assert.Equal(t, map[string]interface{}{ + "logs": []interface{}{ + map[string]interface{}{ + "type": "file", + "path": "/databricks/spark/work/*/*/stderr", + "service": "databricks", + "source": "worker_stderr", + }, + }, + "instances": []interface{}{ + map[string]interface{}{ + "spark_url": "http://localhost:4040", + "spark_cluster_mode": "spark_driver_mode", + "cluster_name": "big-kebab-data", + "streaming_metrics": true, + }, + }, + }, spark) } diff --git a/pkg/fleet/installer/setup/common/packages.go b/pkg/fleet/installer/setup/common/packages.go new file mode 100644 index 0000000000000..c4c0c091ea048 --- /dev/null +++ b/pkg/fleet/installer/setup/common/packages.go @@ -0,0 +1,74 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +package common + +import "fmt" + +const ( + // DatadogInstallerPackage is the datadog installer package + DatadogInstallerPackage string = "datadog-installer" + // DatadogAgentPackage is the datadog agent package + DatadogAgentPackage string = "datadog-agent" + // DatadogAPMInjectPackage is the datadog apm inject package + DatadogAPMInjectPackage string = "datadog-apm-inject" + // DatadogAPMLibraryJavaPackage is the datadog apm library java package + DatadogAPMLibraryJavaPackage string = "datadog-apm-library-java" + // DatadogAPMLibraryPythonPackage is the datadog apm library python package + DatadogAPMLibraryPythonPackage string = "datadog-apm-library-python" + // DatadogAPMLibraryRubyPackage is the datadog apm library ruby package + DatadogAPMLibraryRubyPackage string = "datadog-apm-library-ruby" + // DatadogAPMLibraryJSPackage is the datadog apm library js package + DatadogAPMLibraryJSPackage string = "datadog-apm-library-js" + // DatadogAPMLibraryDotNetPackage is the datadog apm library dotnet package + DatadogAPMLibraryDotNetPackage string = "datadog-apm-library-dotnet" + // DatadogAPMLibraryPHPPackage is the datadog apm library php package + DatadogAPMLibraryPHPPackage string = "datadog-apm-library-php" +) + +var ( + order = []string{ + DatadogInstallerPackage, + DatadogAgentPackage, + DatadogAPMInjectPackage, + DatadogAPMLibraryJavaPackage, + DatadogAPMLibraryPythonPackage, + DatadogAPMLibraryRubyPackage, + DatadogAPMLibraryJSPackage, + DatadogAPMLibraryDotNetPackage, + DatadogAPMLibraryPHPPackage, + } +) + +func resolvePackages(packages Packages) []packageWithVersion { + var resolved []packageWithVersion + for _, pkg := range order { + if p, ok := packages.install[pkg]; ok { + resolved = append(resolved, p) + } + } + if len(resolved) != len(packages.install) { + panic(fmt.Sprintf("unknown package requested: %v", packages.install)) + } + return resolved +} + +// Packages is a list of packages to install +type Packages struct { + install map[string]packageWithVersion +} + +type packageWithVersion struct { + name string + version string +} + +// Install marks a package to be installed +func (p *Packages) Install(pkg string, version string) { + p.install[pkg] = packageWithVersion{ + name: pkg, + version: version, + } +} diff --git a/pkg/fleet/installer/setup/common/setup.go b/pkg/fleet/installer/setup/common/setup.go new file mode 100644 index 0000000000000..dbd48a7f83028 --- /dev/null +++ b/pkg/fleet/installer/setup/common/setup.go @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package common defines the Setup structure that allows setup scripts to define packages and configurations to install. +package common + +import ( + "context" + "errors" + "fmt" + "os" + + "github.com/DataDog/datadog-agent/pkg/fleet/installer" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/oci" + "gopkg.in/DataDog/dd-trace-go.v1/ddtrace" + "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" +) + +const ( + installerOCILayoutURL = "file://." // the installer OCI layout is written by the downloader in the current directory +) + +var ( + // ErrNoAPIKey is returned when no API key is provided. + ErrNoAPIKey = errors.New("no API key provided") +) + +// Setup allows setup scripts to define packages and configurations to install. +type Setup struct { + configDir string + installer installer.Installer + + Env *env.Env + Ctx context.Context + Span ddtrace.Span + Packages Packages + Config Config +} + +// NewSetup creates a new Setup structure with some default values. +func NewSetup(ctx context.Context, env *env.Env, name string) (*Setup, error) { + if env.APIKey == "" { + return nil, ErrNoAPIKey + } + installer, err := installer.NewInstaller(env) + if err != nil { + return nil, fmt.Errorf("failed to create installer: %w", err) + } + span, ctx := tracer.StartSpanFromContext(ctx, fmt.Sprintf("setup.%s", name)) + s := &Setup{ + configDir: configDir, + installer: installer, + Env: env, + Ctx: ctx, + Span: span, + Config: Config{ + DatadogYAML: DatadogConfig{ + APIKey: env.APIKey, + Hostname: os.Getenv("DD_HOSTNAME"), + Site: env.Site, + Env: os.Getenv("DD_ENV"), + }, + IntegrationConfigs: make(map[string]IntegrationConfig), + }, + Packages: Packages{ + install: make(map[string]packageWithVersion), + }, + } + return s, nil +} + +// Run installs the packages and writes the configurations +func (s *Setup) Run() (err error) { + defer func() { s.Span.Finish(tracer.WithError(err)) }() + err = writeConfigs(s.Config, s.configDir) + if err != nil { + return fmt.Errorf("failed to write configuration: %w", err) + } + err = s.installer.Install(s.Ctx, installerOCILayoutURL, nil) + if err != nil { + return fmt.Errorf("failed to install installer: %w", err) + } + packages := resolvePackages(s.Packages) + for _, p := range packages { + url := oci.PackageURL(s.Env, p.name, p.version) + err = s.installer.Install(s.Ctx, url, nil) + if err != nil { + return fmt.Errorf("failed to install package %s: %w", url, err) + } + } + return nil +} diff --git a/pkg/fleet/installer/setup/djm/databricks.go b/pkg/fleet/installer/setup/djm/databricks.go index 0e6675b3aa2ae..2dc8909c58e8b 100644 --- a/pkg/fleet/installer/setup/djm/databricks.go +++ b/pkg/fleet/installer/setup/djm/databricks.go @@ -3,188 +3,149 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build !windows - // Package djm contains data-jobs-monitoring installation logic package djm import ( - "context" + "fmt" "os" - "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/installer/setup/common" "github.com/DataDog/datadog-agent/pkg/util/log" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) const ( databricksInjectorVersion = "0.21.0-1" databricksJavaVersion = "1.41.1-1" databricksAgentVersion = "7.57.2-1" - logsService = "databricks" ) -type databricksSetup struct { - ctx context.Context - *common.HostInstaller - setupIssues []string -} +var ( + envToTags = map[string]string{ + "DATABRICKS_WORKSPACE": "workspace", + "DB_CLUSTER_NAME": "databricks_cluster_name", + "DB_CLUSTER_ID": "databricks_cluster_id", + "DB_NODE_TYPE": "databricks_node_type", + } + driverLogs = []common.IntegrationConfigLogs{ + { + Type: "file", + Path: "/databricks/driver/logs/*.log", + Source: "driver_logs", + Service: "databricks", + }, + { + Type: "file", + Path: "/databricks/driver/logs/stderr", + Source: "driver_stderr", + Service: "databricks", + }, + { + Type: "file", + Path: "/databricks/driver/logs/stdout", + Source: "driver_stdout", + Service: "databricks", + }, + } + workerLogs = []common.IntegrationConfigLogs{ + { + Type: "file", + Path: "/databricks/spark/work/*/*/*.log", + Source: "worker_logs", + Service: "databricks", + }, + { + Type: "file", + Path: "/databricks/spark/work/*/*/stderr", + Source: "worker_stderr", + Service: "databricks", + }, + { + Type: "file", + Path: "/databricks/spark/work/*/*/stdout", + Source: "worker_stdout", + Service: "databricks", + }, + } + tracerEnvConfig = []common.InjectTracerConfigEnvVar{ + { + Key: "DD_DATA_JOBS_ENABLED", + Value: "true", + }, + { + Key: "DD_INTEGRATIONS_ENABLED", + Value: "false", + }, + } +) // SetupDatabricks sets up the Databricks environment -func SetupDatabricks(ctx context.Context, env *env.Env) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "setup.databricks") - defer func() { span.Finish(tracer.WithError(err)) }() +func SetupDatabricks(s *common.Setup) error { + s.Packages.Install(common.DatadogAgentPackage, databricksAgentVersion) - i, err := common.NewHostInstaller(env) + hostname, err := os.Hostname() if err != nil { - return err + return fmt.Errorf("failed to get hostname: %w", err) } - ds := &databricksSetup{ - ctx: ctx, - HostInstaller: i, + s.Config.DatadogYAML.Hostname = hostname + s.Config.DatadogYAML.DJM.Enabled = true + s.Config.DatadogYAML.ExpectedTagsDuration = "10m" + s.Config.DatadogYAML.ProcessConfig.ExpvarPort = 6063 // avoid port conflict on 6062 + for env, tag := range envToTags { + if val, ok := os.LookupEnv(env); ok { + s.Config.DatadogYAML.Tags = append(s.Config.DatadogYAML.Tags, tag+":"+val) + } } - return ds.setup() -} - -func (ds *databricksSetup) setup() error { - // agent binary to install - ds.SetAgentVersion(databricksAgentVersion) - - // avoid port conflict - ds.AddAgentConfig("process_config.expvar_port", -1) - ds.AddAgentConfig("expected_tags_duration", "10m") - ds.AddAgentConfig("djm_config.enabled", true) - - ds.extractHostTagsFromEnv() - span, _ := tracer.SpanFromContext(ds.ctx) switch os.Getenv("DB_IS_DRIVER") { - case "true": - span.SetTag("spark_node", "driver") - return ds.setupDatabricksDriver() + case "TRUE": + setupDatabricksDriver(s) default: - span.SetTag("spark_node", "worker") - return ds.setupDatabricksExecutor() + setupDatabricksWorker(s) } + return nil } -type varExtraction struct { - envVar string - tagKey string -} +func setupDatabricksDriver(s *common.Setup) { + s.Span.SetTag("spark_node", "driver") -var varExtractions = []varExtraction{ - {"DATABRICKS_WORKSPACE", "workspace"}, - {"DB_CLUSTER_NAME", "databricks_cluster_name"}, - {"DB_CLUSTER_ID", "databricks_cluster_id"}, - {"DB_NODE_TYPE", "databricks_node_type"}, -} + s.Packages.Install(common.DatadogAPMInjectPackage, databricksInjectorVersion) + s.Packages.Install(common.DatadogAPMLibraryJavaPackage, databricksJavaVersion) + + s.Config.DatadogYAML.Tags = append(s.Config.DatadogYAML.Tags, "node_type:driver") + s.Config.InjectTracerYAML.AdditionalEnvironmentVariables = tracerEnvConfig -func (ds *databricksSetup) extractHostTagsFromEnv() { - for _, ve := range varExtractions { - if val, ok := os.LookupEnv(ve.envVar); ok { - ds.AddHostTag(ve.tagKey, val) - continue + var sparkIntegration common.IntegrationConfig + if os.Getenv("DRIVER_LOGS_ENABLED") == "true" { + s.Config.DatadogYAML.LogsEnabled = true + sparkIntegration.Logs = driverLogs + } + if os.Getenv("DB_DRIVER_IP") != "" || os.Getenv("DB_DRIVER_PORT") != "" { + sparkIntegration.Instances = []any{ + common.IntegrationConfigInstanceSpark{ + SparkURL: "http://" + os.Getenv("DB_DRIVER_IP") + ":" + os.Getenv("DB_DRIVER_PORT"), + SparkClusterMode: "spark_driver_mode", + ClusterName: os.Getenv("DB_CLUSTER_NAME"), + StreamingMetrics: true, + }, } - ds.setupIssues = append(ds.setupIssues, ve.envVar+"_not_set") + } else { + log.Warn("DB_DRIVER_IP or DB_DRIVER_PORT not set") } + s.Config.IntegrationConfigs["spark.d/databricks.yaml"] = sparkIntegration } -func (ds *databricksSetup) setupDatabricksDriver() error { - ds.AddHostTag("node_type", "driver") - - ds.driverLogCollection() - - ds.setupAgentSparkCheck() - - ds.AddTracerEnv("DD_DATA_JOBS_ENABLED", "true") - ds.AddTracerEnv("DD_INTEGRATIONS_ENABLED", "false") - - // APM binaries to install - ds.SetInjectorVersion(databricksInjectorVersion) - ds.SetJavaTracerVersion(databricksJavaVersion) - - return ds.ConfigureAndInstall(ds.ctx) -} - -func (ds *databricksSetup) setupDatabricksExecutor() error { - ds.AddHostTag("node_type", "worker") - ds.workerLogCollection() - return ds.ConfigureAndInstall(ds.ctx) -} +func setupDatabricksWorker(s *common.Setup) { + s.Span.SetTag("spark_node", "worker") -func (ds *databricksSetup) setupAgentSparkCheck() { - driverIP := os.Getenv("DB_DRIVER_IP") - if driverIP == "" { - log.Warn("DB_DRIVER_IP not set") - return - } - driverPort := os.Getenv("DB_DRIVER_PORT") - if driverPort == "" { - log.Warn("DB_DRIVER_PORT not set") - return - } - clusterName := os.Getenv("DB_CLUSTER_NAME") - - ds.AddSparkInstance(common.SparkInstance{ - SparkURL: "http://" + driverIP + ":" + driverPort, - SparkClusterMode: "spark_driver_mode", - ClusterName: clusterName, - StreamingMetrics: true, - }) -} + s.Packages.Install(common.DatadogAgentPackage, databricksAgentVersion) -func (ds *databricksSetup) driverLogCollection() { - if os.Getenv("DRIVER_LOGS_ENABLED") != "true" { - return - } - span, _ := tracer.SpanFromContext(ds.ctx) - span.SetTag("driver_logs", "enabled") - log.Info("Enabling logs collection on the driver") - ds.AddLogConfig(common.LogConfig{ - Type: "file", - Path: "/databricks/driver/logs/*.log", - Source: "driver_logs", - Service: logsService, - }) - ds.AddLogConfig(common.LogConfig{ - Type: "file", - Path: "/databricks/driver/logs/stderr", - Source: "driver_stderr", - Service: logsService, - }) - ds.AddLogConfig(common.LogConfig{ - Type: "file", - Path: "/databricks/driver/logs/stdout", - Source: "driver_stdout", - Service: logsService, - }) -} + s.Config.DatadogYAML.Tags = append(s.Config.DatadogYAML.Tags, "node_type:worker") -func (ds *databricksSetup) workerLogCollection() { - if os.Getenv("WORKER_LOGS_ENABLED") != "true" { - return + var sparkIntegration common.IntegrationConfig + if os.Getenv("WORKER_LOGS_ENABLED") == "true" { + s.Config.DatadogYAML.LogsEnabled = true + sparkIntegration.Logs = workerLogs } - span, _ := tracer.SpanFromContext(ds.ctx) - span.SetTag("worker_logs", "enabled") - log.Info("Enabling logs collection on the executor") - ds.AddLogConfig(common.LogConfig{ - Type: "file", - Path: "/databricks/spark/work/*/*/*.log", - Source: "worker_logs", - Service: logsService, - }) - ds.AddLogConfig(common.LogConfig{ - Type: "file", - Path: "/databricks/spark/work/*/*/stderr", - Source: "worker_stderr", - Service: logsService, - }) - ds.AddLogConfig(common.LogConfig{ - Type: "file", - Path: "/databricks/spark/work/*/*/stdout", - Source: "worker_stdout", - Service: logsService, - }) + s.Config.IntegrationConfigs["spark.d/databricks.yaml"] = sparkIntegration } diff --git a/pkg/fleet/installer/setup/djm/databricks_windows.go b/pkg/fleet/installer/setup/djm/databricks_windows.go deleted file mode 100644 index 2bad2770e3467..0000000000000 --- a/pkg/fleet/installer/setup/djm/databricks_windows.go +++ /dev/null @@ -1,21 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -//go:build windows - -// Package djm contains data-jobs-monitoring installation logic -package djm - -import ( - "context" - "errors" - - "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" -) - -// SetupDatabricks is a not supported on windows -func SetupDatabricks(_ context.Context, _ *env.Env) error { - return errors.New("djm is not supported on windows") -} diff --git a/pkg/fleet/installer/setup/install.sh b/pkg/fleet/installer/setup/install.sh index d76e790de910f..074b275028111 100644 --- a/pkg/fleet/installer/setup/install.sh +++ b/pkg/fleet/installer/setup/install.sh @@ -15,8 +15,10 @@ downloader_path="${tmp_dir}/download-installer" install() { if [ "$UID" == "0" ]; then sudo_cmd='' + sudo_cmd_with_envs='' else sudo_cmd='sudo' + sudo_cmd_with_envs='sudo -E' fi $sudo_cmd mkdir -p "${tmp_dir}" @@ -30,7 +32,7 @@ install() { esac $sudo_cmd chmod +x "${downloader_path}" echo "Starting the Datadog installer..." - $sudo_cmd "${downloader_path}" "$@" + $sudo_cmd_with_envs "${downloader_path}" "$@" $sudo_cmd rm -f "${downloader_path}" } diff --git a/pkg/fleet/installer/setup/setup.go b/pkg/fleet/installer/setup/setup.go index 0daa479d73b6e..3b01d320c9975 100644 --- a/pkg/fleet/installer/setup/setup.go +++ b/pkg/fleet/installer/setup/setup.go @@ -11,7 +11,7 @@ import ( "fmt" "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" - "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages" + "github.com/DataDog/datadog-agent/pkg/fleet/installer/setup/common" "github.com/DataDog/datadog-agent/pkg/fleet/installer/setup/djm" "github.com/DataDog/datadog-agent/pkg/fleet/internal/exec" "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" @@ -24,18 +24,20 @@ const ( // Setup installs Datadog. func Setup(ctx context.Context, env *env.Env, flavor string) error { + s, err := common.NewSetup(ctx, env, flavor) + if err != nil { + return err + } switch flavor { case FlavorDatabricks: - if err := packages.SetupInstaller(ctx); err != nil { - return fmt.Errorf("failed to setup installer: %w", err) - } - if err := djm.SetupDatabricks(ctx, env); err != nil { - return fmt.Errorf("failed to setup Databricks: %w", err) - } - return nil + err = djm.SetupDatabricks(s) default: return fmt.Errorf("unknown setup flavor %s", flavor) } + if err != nil { + return err + } + return s.Run() } // Agent7InstallScript is the setup used by the agent7 install script. diff --git a/pkg/gohai/go.mod b/pkg/gohai/go.mod index fb749217ba632..45edc82c08f38 100644 --- a/pkg/gohai/go.mod +++ b/pkg/gohai/go.mod @@ -7,7 +7,7 @@ go 1.23.0 require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 github.com/moby/sys/mountinfo v0.7.2 - github.com/shirou/gopsutil/v3 v3.24.5 + github.com/shirou/gopsutil/v4 v4.24.11 github.com/stretchr/testify v1.10.0 golang.org/x/sys v0.28.0 ) @@ -17,12 +17,11 @@ require ( github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shoenig/test v1.7.1 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect diff --git a/pkg/gohai/go.sum b/pkg/gohai/go.sum index d08fc94f6ffe7..99c1b368ae068 100644 --- a/pkg/gohai/go.sum +++ b/pkg/gohai/go.sum @@ -2,6 +2,8 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -22,12 +24,8 @@ github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkB github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= diff --git a/pkg/gohai/processes/gops/process_info.go b/pkg/gohai/processes/gops/process_info.go index 9f830d935ea47..bdbd3c4601109 100644 --- a/pkg/gohai/processes/gops/process_info.go +++ b/pkg/gohai/processes/gops/process_info.go @@ -12,8 +12,8 @@ import ( "fmt" "runtime" - "github.com/shirou/gopsutil/v3/mem" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/mem" + "github.com/shirou/gopsutil/v4/process" "github.com/DataDog/datadog-agent/pkg/util/log" ) diff --git a/pkg/internaltelemetry/client.go b/pkg/internaltelemetry/client.go index 4469ba0d0f060..52b1b2010edf0 100644 --- a/pkg/internaltelemetry/client.go +++ b/pkg/internaltelemetry/client.go @@ -25,7 +25,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/trace/config" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/version" - "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v4/host" ) const ( diff --git a/pkg/logs/auditor/go.mod b/pkg/logs/auditor/go.mod index ddbd7465dad7f..d375aa6e7038d 100644 --- a/pkg/logs/auditor/go.mod +++ b/pkg/logs/auditor/go.mod @@ -72,10 +72,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -88,8 +89,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/logs/auditor/go.sum b/pkg/logs/auditor/go.sum index b60bbee1b243d..6df24d44986c1 100644 --- a/pkg/logs/auditor/go.sum +++ b/pkg/logs/auditor/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/client/go.mod b/pkg/logs/client/go.mod index 98d517064e966..8ca05dfb2f632 100644 --- a/pkg/logs/client/go.mod +++ b/pkg/logs/client/go.mod @@ -89,13 +89,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -115,8 +116,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/logs/client/go.sum b/pkg/logs/client/go.sum index 1280297d26d15..65b369f190875 100644 --- a/pkg/logs/client/go.sum +++ b/pkg/logs/client/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -40,6 +40,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -174,12 +176,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/diagnostic/go.mod b/pkg/logs/diagnostic/go.mod index 5d1ec2ef8d375..b8ef753620e44 100644 --- a/pkg/logs/diagnostic/go.mod +++ b/pkg/logs/diagnostic/go.mod @@ -76,10 +76,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -93,8 +94,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/logs/diagnostic/go.sum b/pkg/logs/diagnostic/go.sum index 1441562d69bde..e3973187c6caa 100644 --- a/pkg/logs/diagnostic/go.sum +++ b/pkg/logs/diagnostic/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -39,6 +39,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -169,12 +171,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/message/go.mod b/pkg/logs/message/go.mod index 926d1755736a7..463f6366031f4 100644 --- a/pkg/logs/message/go.mod +++ b/pkg/logs/message/go.mod @@ -68,10 +68,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -84,8 +85,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/logs/message/go.sum b/pkg/logs/message/go.sum index b60bbee1b243d..6df24d44986c1 100644 --- a/pkg/logs/message/go.sum +++ b/pkg/logs/message/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/pipeline/go.mod b/pkg/logs/pipeline/go.mod index 8e94ae545d913..8b584b5b1aa03 100644 --- a/pkg/logs/pipeline/go.mod +++ b/pkg/logs/pipeline/go.mod @@ -107,13 +107,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -135,8 +136,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/logs/pipeline/go.sum b/pkg/logs/pipeline/go.sum index 2046340fbb070..0816ff6b27cb5 100644 --- a/pkg/logs/pipeline/go.sum +++ b/pkg/logs/pipeline/go.sum @@ -4,8 +4,8 @@ github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytlju github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 h1:RoH7VLzTnxHEugRPIgnGlxwDFszFGI7b3WZZUtWuPRM= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42/go.mod h1:TX7CTOQ3LbQjfAi4SwqUoR5gY1zfUk7VRBDTuArjaDc= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -44,6 +44,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -186,12 +188,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/processor/go.mod b/pkg/logs/processor/go.mod index 92711d3f0904c..ffa047656aa16 100644 --- a/pkg/logs/processor/go.mod +++ b/pkg/logs/processor/go.mod @@ -87,13 +87,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -114,8 +115,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/logs/processor/go.sum b/pkg/logs/processor/go.sum index 90a3df8fcf57a..df30b2959c6d8 100644 --- a/pkg/logs/processor/go.sum +++ b/pkg/logs/processor/go.sum @@ -4,8 +4,8 @@ github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytlju github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 h1:RoH7VLzTnxHEugRPIgnGlxwDFszFGI7b3WZZUtWuPRM= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42/go.mod h1:TX7CTOQ3LbQjfAi4SwqUoR5gY1zfUk7VRBDTuArjaDc= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -44,6 +44,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -181,12 +183,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/sds/go.mod b/pkg/logs/sds/go.mod index de57c77f0c334..71861e9789dd6 100644 --- a/pkg/logs/sds/go.mod +++ b/pkg/logs/sds/go.mod @@ -83,12 +83,13 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -108,8 +109,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/logs/sds/go.sum b/pkg/logs/sds/go.sum index f4fe0336fb3e7..ba2765ae6cc8c 100644 --- a/pkg/logs/sds/go.sum +++ b/pkg/logs/sds/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 h1:RoH7VLzTnxHEugRPIgnGlxwDFszFGI7b3WZZUtWuPRM= github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42/go.mod h1:TX7CTOQ3LbQjfAi4SwqUoR5gY1zfUk7VRBDTuArjaDc= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -40,6 +40,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -174,12 +176,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/sender/go.mod b/pkg/logs/sender/go.mod index 34f1b22725b61..c6222c7c0214c 100644 --- a/pkg/logs/sender/go.mod +++ b/pkg/logs/sender/go.mod @@ -90,12 +90,13 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -115,8 +116,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/logs/sender/go.sum b/pkg/logs/sender/go.sum index 1280297d26d15..65b369f190875 100644 --- a/pkg/logs/sender/go.sum +++ b/pkg/logs/sender/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -40,6 +40,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -174,12 +176,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/sources/go.mod b/pkg/logs/sources/go.mod index d4cb6c8fae893..736839618c355 100644 --- a/pkg/logs/sources/go.mod +++ b/pkg/logs/sources/go.mod @@ -66,10 +66,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -82,8 +83,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/logs/sources/go.sum b/pkg/logs/sources/go.sum index b60bbee1b243d..6df24d44986c1 100644 --- a/pkg/logs/sources/go.sum +++ b/pkg/logs/sources/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/logs/util/testutils/go.mod b/pkg/logs/util/testutils/go.mod index c8bdb9b516e9f..6c8ce3a26dae3 100644 --- a/pkg/logs/util/testutils/go.mod +++ b/pkg/logs/util/testutils/go.mod @@ -67,9 +67,10 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -81,8 +82,7 @@ require ( github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/logs/util/testutils/go.sum b/pkg/logs/util/testutils/go.sum index b60bbee1b243d..6df24d44986c1 100644 --- a/pkg/logs/util/testutils/go.sum +++ b/pkg/logs/util/testutils/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/metrics/go.mod b/pkg/metrics/go.mod index 98ca0a495a8db..e506cd41e855c 100644 --- a/pkg/metrics/go.mod +++ b/pkg/metrics/go.mod @@ -74,13 +74,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -100,8 +101,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/metrics/go.sum b/pkg/metrics/go.sum index 5bbafd25cf4f1..6316d64a4973c 100644 --- a/pkg/metrics/go.sum +++ b/pkg/metrics/go.sum @@ -6,8 +6,8 @@ github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdus github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -46,6 +46,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -182,12 +184,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/metrics/metricsource.go b/pkg/metrics/metricsource.go index 57a802188d380..f3afa888d60b4 100644 --- a/pkg/metrics/metricsource.go +++ b/pkg/metrics/metricsource.go @@ -307,6 +307,7 @@ const ( MetricSourceAppgateSDP MetricSourceAnyscale MetricSourceMilvus + MetricSourceNvidiaNim ) // String returns a string representation of MetricSource @@ -714,6 +715,8 @@ func (ms MetricSource) String() string { return "karpenter" case MetricSourceNvidiaTriton: return "nvidia_triton" + case MetricSourceNvidiaNim: + return "nvidia_nim" case MetricSourceRay: return "ray" case MetricSourceStrimzi: @@ -1248,6 +1251,8 @@ func CheckNameToMetricSource(name string) MetricSource { return MetricSourceKarpenter case "nvidia_triton": return MetricSourceNvidiaTriton + case "nvidia_nim": + return MetricSourceNvidiaNim case "ray": return MetricSourceRay case "strimzi": diff --git a/pkg/networkdevice/pinger/pinger_linux.go b/pkg/networkdevice/pinger/pinger_linux.go index 89476acbc920b..5b8ff36bac672 100644 --- a/pkg/networkdevice/pinger/pinger_linux.go +++ b/pkg/networkdevice/pinger/pinger_linux.go @@ -9,10 +9,13 @@ package pinger import ( "encoding/json" + "fmt" + "net/http" + "time" + sysprobeclient "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" + sysconfig "github.com/DataDog/datadog-agent/cmd/system-probe/config" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" - "github.com/DataDog/datadog-agent/pkg/process/net" - "github.com/DataDog/datadog-agent/pkg/util/log" ) const ( @@ -22,14 +25,16 @@ const ( // LinuxPinger implements the Pinger interface for // Linux users type LinuxPinger struct { - cfg Config + cfg Config + sysprobeClient *http.Client } // New creates a LinuxPinger using the passed in // config func New(cfg Config) (Pinger, error) { return &LinuxPinger{ - cfg: cfg, + cfg: cfg, + sysprobeClient: sysprobeclient.Get(pkgconfigsetup.SystemProbe().GetString("system_probe_config.sysprobe_socket")), }, nil } @@ -41,21 +46,41 @@ func (p *LinuxPinger) Ping(host string) (*Result, error) { return RunPing(&p.cfg, host) } - tu, err := net.GetRemoteSystemProbeUtil( - pkgconfigsetup.SystemProbe().GetString("system_probe_config.sysprobe_socket")) + return getPing(p.sysprobeClient, clientID, host, p.cfg.Count, p.cfg.Interval, p.cfg.Timeout) +} + +func getPing(client *http.Client, clientID string, host string, count int, interval time.Duration, timeout time.Duration) (*Result, error) { + url := sysprobeclient.ModuleURL(sysconfig.PingModule, fmt.Sprintf("/ping/%s?client_id=%s&count=%d&interval=%d&timeout=%d", host, clientID, count, interval, timeout)) + req, err := http.NewRequest("GET", url, nil) if err != nil { - log.Warnf("could not initialize system-probe connection: %s", err.Error()) return nil, err } - resp, err := tu.GetPing(clientID, host, p.cfg.Count, p.cfg.Interval, p.cfg.Timeout) + + req.Header.Set("Accept", "application/json") + resp, err := client.Do(req) if err != nil { return nil, err } + defer resp.Body.Close() - var result Result - if err := json.Unmarshal(resp, &result); err != nil { + if resp.StatusCode == http.StatusBadRequest { + body, err := sysprobeclient.ReadAllResponseBody(resp) + if err != nil { + return nil, fmt.Errorf("ping request failed: url: %s, status code: %d", req.URL, resp.StatusCode) + } + return nil, fmt.Errorf("ping request failed: url: %s, status code: %d, error: %s", req.URL, resp.StatusCode, string(body)) + } else if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("ping request failed: url: %s, status code: %d", req.URL, resp.StatusCode) + } + + body, err := sysprobeclient.ReadAllResponseBody(resp) + if err != nil { return nil, err } + var result Result + if err := json.Unmarshal(body, &result); err != nil { + return nil, err + } return &result, nil } diff --git a/pkg/networkpath/traceroute/sysprobe.go b/pkg/networkpath/traceroute/sysprobe.go new file mode 100644 index 0000000000000..f95974f059a88 --- /dev/null +++ b/pkg/networkpath/traceroute/sysprobe.go @@ -0,0 +1,57 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2024-present Datadog, Inc. + +//go:build linux || windows + +package traceroute + +import ( + "context" + "fmt" + "net/http" + "time" + + sysprobeclient "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" + sysconfig "github.com/DataDog/datadog-agent/cmd/system-probe/config" + "github.com/DataDog/datadog-agent/pkg/networkpath/payload" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +func getTraceroute(client *http.Client, clientID string, host string, port uint16, protocol payload.Protocol, maxTTL uint8, timeout time.Duration) ([]byte, error) { + httpTimeout := timeout*time.Duration(maxTTL) + 10*time.Second // allow extra time for the system probe communication overhead, calculate full timeout for TCP traceroute + log.Tracef("Network Path traceroute HTTP request timeout: %s", httpTimeout) + ctx, cancel := context.WithTimeout(context.Background(), httpTimeout) + defer cancel() + + url := sysprobeclient.ModuleURL(sysconfig.TracerouteModule, fmt.Sprintf("/traceroute/%s?client_id=%s&port=%d&max_ttl=%d&timeout=%d&protocol=%s", host, clientID, port, maxTTL, timeout, protocol)) + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", "application/json") + resp, err := client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode == http.StatusBadRequest { + body, err := sysprobeclient.ReadAllResponseBody(resp) + if err != nil { + return nil, fmt.Errorf("traceroute request failed: url: %s, status code: %d", req.URL, resp.StatusCode) + } + return nil, fmt.Errorf("traceroute request failed: url: %s, status code: %d, error: %s", req.URL, resp.StatusCode, string(body)) + } else if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("traceroute request failed: url: %s, status code: %d", req.URL, resp.StatusCode) + } + + body, err := sysprobeclient.ReadAllResponseBody(resp) + if err != nil { + return nil, err + } + + return body, nil +} diff --git a/pkg/networkpath/traceroute/traceroute_linux.go b/pkg/networkpath/traceroute/traceroute_linux.go index 536d360f4f6c3..e3d54f61ccf48 100644 --- a/pkg/networkpath/traceroute/traceroute_linux.go +++ b/pkg/networkpath/traceroute/traceroute_linux.go @@ -10,12 +10,13 @@ package traceroute import ( "context" "encoding/json" + "net/http" + sysprobeclient "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" "github.com/DataDog/datadog-agent/comp/core/telemetry" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/networkpath/payload" "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/config" - "github.com/DataDog/datadog-agent/pkg/process/net" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -27,7 +28,8 @@ const ( // running traceroute from an agent running // on Linux type LinuxTraceroute struct { - cfg config.Config + cfg config.Config + sysprobeClient *http.Client } // New creates a new instance of LinuxTraceroute @@ -36,19 +38,17 @@ func New(cfg config.Config, _ telemetry.Component) (*LinuxTraceroute, error) { log.Debugf("Creating new traceroute with config: %+v", cfg) return &LinuxTraceroute{ cfg: cfg, + sysprobeClient: &http.Client{ + Transport: &http.Transport{ + DialContext: sysprobeclient.DialContextFunc(pkgconfigsetup.SystemProbe().GetString("system_probe_config.sysprobe_socket")), + }, + }, }, nil } // Run executes a traceroute func (l *LinuxTraceroute) Run(_ context.Context) (payload.NetworkPath, error) { - tu, err := net.GetRemoteSystemProbeUtil( - pkgconfigsetup.SystemProbe().GetString("system_probe_config.sysprobe_socket")) - if err != nil { - log.Warnf("could not initialize system-probe connection: %s", err.Error()) - return payload.NetworkPath{}, err - } - - resp, err := tu.GetTraceroute(clientID, l.cfg.DestHostname, l.cfg.DestPort, l.cfg.Protocol, l.cfg.MaxTTL, l.cfg.Timeout) + resp, err := getTraceroute(l.sysprobeClient, clientID, l.cfg.DestHostname, l.cfg.DestPort, l.cfg.Protocol, l.cfg.MaxTTL, l.cfg.Timeout) if err != nil { return payload.NetworkPath{}, err } diff --git a/pkg/networkpath/traceroute/traceroute_windows.go b/pkg/networkpath/traceroute/traceroute_windows.go index 316caabd7cb03..8e05c249e4a35 100644 --- a/pkg/networkpath/traceroute/traceroute_windows.go +++ b/pkg/networkpath/traceroute/traceroute_windows.go @@ -11,12 +11,13 @@ import ( "context" "encoding/json" "errors" + "net/http" + sysprobeclient "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" "github.com/DataDog/datadog-agent/comp/core/telemetry" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/networkpath/payload" "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/config" - "github.com/DataDog/datadog-agent/pkg/process/net" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -29,7 +30,8 @@ const ( // running traceroute from an agent running // on Windows type WindowsTraceroute struct { - cfg config.Config + cfg config.Config + sysprobeClient *http.Client } // New creates a new instance of WindowsTraceroute @@ -44,18 +46,17 @@ func New(cfg config.Config, _ telemetry.Component) (*WindowsTraceroute, error) { return &WindowsTraceroute{ cfg: cfg, + sysprobeClient: &http.Client{ + Transport: &http.Transport{ + DialContext: sysprobeclient.DialContextFunc(pkgconfigsetup.SystemProbe().GetString("system_probe_config.sysprobe_socket")), + }, + }, }, nil } // Run executes a traceroute func (w *WindowsTraceroute) Run(_ context.Context) (payload.NetworkPath, error) { - tu, err := net.GetRemoteSystemProbeUtil( - pkgconfigsetup.SystemProbe().GetString("system_probe_config.sysprobe_socket")) - if err != nil { - log.Warnf("could not initialize system-probe connection: %s", err.Error()) - return payload.NetworkPath{}, err - } - resp, err := tu.GetTraceroute(clientID, w.cfg.DestHostname, w.cfg.DestPort, w.cfg.Protocol, w.cfg.MaxTTL, w.cfg.Timeout) + resp, err := getTraceroute(w.sysprobeClient, clientID, w.cfg.DestHostname, w.cfg.DestPort, w.cfg.Protocol, w.cfg.MaxTTL, w.cfg.Timeout) if err != nil { return payload.NetworkPath{}, err } diff --git a/pkg/process/checks/container.go b/pkg/process/checks/container.go index 533c6f55a050f..3d18e0ed02daf 100644 --- a/pkg/process/checks/container.go +++ b/pkg/process/checks/container.go @@ -8,14 +8,15 @@ package checks import ( "fmt" "math" + "net/http" "sync" "time" model "github.com/DataDog/agent-payload/v5/process" + "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" - "github.com/DataDog/datadog-agent/pkg/process/net" "github.com/DataDog/datadog-agent/pkg/process/statsd" proccontainers "github.com/DataDog/datadog-agent/pkg/process/util/containers" "github.com/DataDog/datadog-agent/pkg/util/flavor" @@ -49,6 +50,8 @@ type ContainerCheck struct { maxBatchSize int wmeta workloadmeta.Component + + sysprobeClient *http.Client } // Init initializes a ContainerCheck instance. @@ -60,16 +63,11 @@ func (c *ContainerCheck) Init(syscfg *SysProbeConfig, info *HostInfo, _ bool) er c.containerProvider = sharedContainerProvider c.hostInfo = info - var tu net.SysProbeUtil if syscfg.NetworkTracerModuleEnabled { - // Calling the remote tracer will cause it to initialize and check connectivity - tu, err = net.GetRemoteSystemProbeUtil(syscfg.SystemProbeAddress) - if err != nil { - log.Warnf("could not initiate connection with system probe: %s", err) - } + c.sysprobeClient = client.Get(syscfg.SystemProbeAddress) } - networkID, err := retryGetNetworkID(tu) + networkID, err := retryGetNetworkID(c.sysprobeClient) if err != nil { log.Infof("no network ID detected: %s", err) } diff --git a/pkg/process/checks/net.go b/pkg/process/checks/net.go index 054ce6a4fb670..169cf139ac995 100644 --- a/pkg/process/checks/net.go +++ b/pkg/process/checks/net.go @@ -7,15 +7,16 @@ package checks import ( "context" - "errors" + "fmt" + "net/http" "runtime" "sort" "time" - "github.com/benbjohnson/clock" - model "github.com/DataDog/agent-payload/v5/process" + "github.com/benbjohnson/clock" + sysprobeclient "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" sysconfig "github.com/DataDog/datadog-agent/cmd/system-probe/config" sysconfigtypes "github.com/DataDog/datadog-agent/cmd/system-probe/config/types" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" @@ -23,6 +24,7 @@ import ( "github.com/DataDog/datadog-agent/comp/networkpath/npcollector" pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" "github.com/DataDog/datadog-agent/pkg/network/dns" + netEncoding "github.com/DataDog/datadog-agent/pkg/network/encoding/unmarshal" "github.com/DataDog/datadog-agent/pkg/process/metadata/parser" "github.com/DataDog/datadog-agent/pkg/process/net" "github.com/DataDog/datadog-agent/pkg/process/net/resolver" @@ -39,9 +41,6 @@ const ( ) var ( - // ErrTracerStillNotInitialized signals that the tracer is _still_ not ready, so we shouldn't log additional errors - ErrTracerStillNotInitialized = errors.New("remote tracer is still not initialized") - // ProcessAgentClientID process-agent unique ID ProcessAgentClientID = "process-agent-unique-id" ) @@ -65,7 +64,6 @@ type ConnectionsCheck struct { hostInfo *HostInfo maxConnsPerMessage int - tracerClientID string networkID string notInitializedLogLimit *log.Limit @@ -79,6 +77,8 @@ type ConnectionsCheck struct { wmeta workloadmeta.Component npCollector npcollector.Component + + sysprobeClient *http.Client } // ProcessConnRates describes connection rates for processes @@ -89,25 +89,16 @@ func (c *ConnectionsCheck) Init(syscfg *SysProbeConfig, hostInfo *HostInfo, _ bo c.hostInfo = hostInfo c.maxConnsPerMessage = syscfg.MaxConnsPerMessage c.notInitializedLogLimit = log.NewLogLimit(1, time.Minute*10) + c.sysprobeClient = sysprobeclient.Get(syscfg.SystemProbeAddress) - // We use the current process PID as the system-probe client ID - c.tracerClientID = ProcessAgentClientID - - // Calling the remote tracer will cause it to initialize and check connectivity - tu, err := net.GetRemoteSystemProbeUtil(syscfg.SystemProbeAddress) - + // Register process agent as a system probe's client + // This ensures we start recording data from now to the first call to `Run` + err := c.register() if err != nil { - log.Warnf("could not initiate connection with system probe: %s", err) - } else { - // Register process agent as a system probe's client - // This ensures we start recording data from now to the first call to `Run` - err = tu.Register(c.tracerClientID) - if err != nil { - log.Warnf("could not register process-agent to system-probe: %s", err) - } + log.Warnf("could not register process-agent to system-probe: %s", err) } - networkID, err := retryGetNetworkID(tu) + networkID, err := retryGetNetworkID(c.sysprobeClient) if err != nil { log.Infof("no network ID detected: %s", err) } @@ -172,10 +163,6 @@ func (c *ConnectionsCheck) Run(nextGroupID func() int32, _ *RunOptions) (RunResu conns, err := c.getConnections() if err != nil { - // If the tracer is not initialized, or still not initialized, then we want to exit without error'ing - if errors.Is(err, net.ErrNotImplemented) || errors.Is(err, ErrTracerStillNotInitialized) { - return nil, nil - } return nil, err } @@ -205,15 +192,48 @@ func (c *ConnectionsCheck) Cleanup() { c.localresolver.Stop() } +func (c *ConnectionsCheck) register() error { + url := sysprobeclient.ModuleURL(sysconfig.NetworkTracerModule, "/register?client_id="+ProcessAgentClientID) + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return err + } + + resp, err := c.sysprobeClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("conn request failed: url: %s, status code: %d", req.URL, resp.StatusCode) + } + return nil +} + func (c *ConnectionsCheck) getConnections() (*model.Connections, error) { - tu, err := net.GetRemoteSystemProbeUtil(c.syscfg.SocketAddress) + url := sysprobeclient.ModuleURL(sysconfig.NetworkTracerModule, "/connections?client_id="+ProcessAgentClientID) + req, err := http.NewRequest("GET", url, nil) if err != nil { - if c.notInitializedLogLimit.ShouldLog() { - log.Warnf("could not initialize system-probe connection: %v (will only log every 10 minutes)", err) - } - return nil, ErrTracerStillNotInitialized + return nil, err } - return tu.GetConnections(c.tracerClientID) + + req.Header.Set("Accept", "application/protobuf") + resp, err := c.sysprobeClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("conn request failed: url: %s, status code: %d", req.URL, resp.StatusCode) + } + + body, err := sysprobeclient.ReadAllResponseBody(resp) + if err != nil { + return nil, err + } + + contentType := resp.Header.Get("Content-type") + return netEncoding.GetUnmarshaler(contentType).Unmarshal(body) } func (c *ConnectionsCheck) notifyProcessConnRates(config pkgconfigmodel.Reader, conns *model.Connections) { @@ -509,11 +529,11 @@ func convertAndEnrichWithServiceCtx(tags []string, tagOffsets []uint32, serviceC } // fetches network_id from the current netNS or from the system probe if necessary, where the root netNS is used -func retryGetNetworkID(sysProbeUtil net.SysProbeUtil) (string, error) { +func retryGetNetworkID(sysProbeClient *http.Client) (string, error) { networkID, err := cloudproviders.GetNetworkID(context.TODO()) - if err != nil && sysProbeUtil != nil { + if err != nil && sysProbeClient != nil { log.Infof("no network ID detected. retrying via system-probe: %s", err) - networkID, err = sysProbeUtil.GetNetworkID() + networkID, err = net.GetNetworkID(sysProbeClient) if err != nil { log.Infof("failed to get network ID from system-probe: %s", err) return "", err diff --git a/pkg/process/checks/process.go b/pkg/process/checks/process.go index f1837d183e540..add33a5f22d6a 100644 --- a/pkg/process/checks/process.go +++ b/pkg/process/checks/process.go @@ -9,14 +9,16 @@ import ( "errors" "fmt" "math" + "net/http" "regexp" "strings" "time" model "github.com/DataDog/agent-payload/v5/process" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "go.uber.org/atomic" + "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" workloadmetacomp "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" @@ -123,6 +125,8 @@ type ProcessCheck struct { serviceExtractor *parser.ServiceExtractor wmeta workloadmetacomp.Component + + sysprobeClient *http.Client } // Init initializes the singleton ProcessCheck. @@ -140,17 +144,11 @@ func (p *ProcessCheck) Init(syscfg *SysProbeConfig, info *HostInfo, oneShot bool p.notInitializedLogLimit = log.NewLogLimit(1, time.Minute*10) - var tu net.SysProbeUtil - - if syscfg.NetworkTracerModuleEnabled { - // Calling the remote tracer will cause it to initialize and check connectivity - tu, err = net.GetRemoteSystemProbeUtil(syscfg.SystemProbeAddress) - if err != nil { - log.Warnf("could not initiate connection with system probe: %s", err) - } + if syscfg.NetworkTracerModuleEnabled || syscfg.ProcessModuleEnabled { + p.sysprobeClient = client.Get(syscfg.SystemProbeAddress) } - networkID, err := retryGetNetworkID(tu) + networkID, err := retryGetNetworkID(p.sysprobeClient) if err != nil { log.Infof("no network ID detected: %s", err) } @@ -271,8 +269,13 @@ func (p *ProcessCheck) run(groupID int32, collectRealTime bool) (RunResult, erro p.lastPIDs = append(p.lastPIDs, pid) } - if sysProbeUtil := p.getRemoteSysProbeUtil(); sysProbeUtil != nil { - mergeProcWithSysprobeStats(p.lastPIDs, procs, sysProbeUtil) + if p.sysprobeClient != nil && p.sysProbeConfig.ProcessModuleEnabled { + pStats, err := net.GetProcStats(p.sysprobeClient, p.lastPIDs) + if err == nil { + mergeProcWithSysprobeStats(procs, pStats) + } else { + log.Debugf("cannot do GetProcStats from system-probe for process check: %s", err) + } } var containers []*model.Container @@ -661,36 +664,16 @@ func skipProcess( return false } -func (p *ProcessCheck) getRemoteSysProbeUtil() net.SysProbeUtil { - if !p.sysProbeConfig.ProcessModuleEnabled { - return nil - } - - pu, err := net.GetRemoteSystemProbeUtil(p.sysProbeConfig.SystemProbeAddress) - if err != nil { - if p.notInitializedLogLimit.ShouldLog() { - log.Warnf("could not initialize system-probe connection in process check: %v (will only log every 10 minutes)", err) - } - return nil - } - return pu -} - // mergeProcWithSysprobeStats takes a process by PID map and fill the stats from system probe into the processes in the map -func mergeProcWithSysprobeStats(pids []int32, procs map[int32]*procutil.Process, pu net.SysProbeUtil) { - pStats, err := pu.GetProcStats(pids) - if err == nil { - for pid, proc := range procs { - if s, ok := pStats.StatsByPID[pid]; ok { - proc.Stats.OpenFdCount = s.OpenFDCount - proc.Stats.IOStat.ReadCount = s.ReadCount - proc.Stats.IOStat.WriteCount = s.WriteCount - proc.Stats.IOStat.ReadBytes = s.ReadBytes - proc.Stats.IOStat.WriteBytes = s.WriteBytes - } +func mergeProcWithSysprobeStats(procs map[int32]*procutil.Process, pStats *model.ProcStatsWithPermByPID) { + for pid, proc := range procs { + if s, ok := pStats.StatsByPID[pid]; ok { + proc.Stats.OpenFdCount = s.OpenFDCount + proc.Stats.IOStat.ReadCount = s.ReadCount + proc.Stats.IOStat.WriteCount = s.WriteCount + proc.Stats.IOStat.ReadBytes = s.ReadBytes + proc.Stats.IOStat.WriteBytes = s.WriteBytes } - } else { - log.Debugf("cannot do GetProcStats from system-probe for process check: %s", err) } } diff --git a/pkg/process/checks/process_common_test.go b/pkg/process/checks/process_common_test.go index 129b1c436aa88..4e8d5a7b6cbf5 100644 --- a/pkg/process/checks/process_common_test.go +++ b/pkg/process/checks/process_common_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/process/checks/process_nix.go b/pkg/process/checks/process_nix.go index 4fe8a11e1ea92..1fd0bc4d89452 100644 --- a/pkg/process/checks/process_nix.go +++ b/pkg/process/checks/process_nix.go @@ -13,7 +13,7 @@ import ( "strconv" model "github.com/DataDog/agent-payload/v5/process" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/DataDog/datadog-agent/pkg/process/procutil" "github.com/DataDog/datadog-agent/pkg/util/system" diff --git a/pkg/process/checks/process_nix_test.go b/pkg/process/checks/process_nix_test.go index 2cbd10d5e3217..c819e7fddebd7 100644 --- a/pkg/process/checks/process_nix_test.go +++ b/pkg/process/checks/process_nix_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/assert" model "github.com/DataDog/agent-payload/v5/process" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/DataDog/datadog-agent/pkg/process/metadata/parser" "github.com/DataDog/datadog-agent/pkg/process/procutil" diff --git a/pkg/process/checks/process_rt.go b/pkg/process/checks/process_rt.go index 33bf93f06a793..e218a80fa732e 100644 --- a/pkg/process/checks/process_rt.go +++ b/pkg/process/checks/process_rt.go @@ -6,10 +6,11 @@ package checks import ( + "net/http" "time" model "github.com/DataDog/agent-payload/v5/process" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/DataDog/datadog-agent/pkg/process/net" "github.com/DataDog/datadog-agent/pkg/process/procutil" @@ -38,8 +39,8 @@ func (p *ProcessCheck) runRealtime(groupID int32) (RunResult, error) { return nil, err } - if sysProbeUtil := p.getRemoteSysProbeUtil(); sysProbeUtil != nil { - mergeStatWithSysprobeStats(p.lastPIDs, procs, sysProbeUtil) + if p.sysprobeClient != nil && p.sysProbeConfig.ProcessModuleEnabled { + mergeStatWithSysprobeStats(p.lastPIDs, procs, p.sysprobeClient) } var containers []*model.Container @@ -160,8 +161,8 @@ func calculateRate(cur, prev uint64, before time.Time) float32 { } // mergeStatWithSysprobeStats takes a process by PID map and fill the stats from system probe into the processes in the map -func mergeStatWithSysprobeStats(pids []int32, stats map[int32]*procutil.Stats, pu net.SysProbeUtil) { - pStats, err := pu.GetProcStats(pids) +func mergeStatWithSysprobeStats(pids []int32, stats map[int32]*procutil.Stats, client *http.Client) { + pStats, err := net.GetProcStats(client, pids) if err == nil { for pid, stats := range stats { if s, ok := pStats.StatsByPID[pid]; ok { diff --git a/pkg/process/checks/process_test.go b/pkg/process/checks/process_test.go index c1f4be9e64388..d306809c51967 100644 --- a/pkg/process/checks/process_test.go +++ b/pkg/process/checks/process_test.go @@ -13,7 +13,7 @@ import ( "time" model "github.com/DataDog/agent-payload/v5/process" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/pkg/process/checks/process_windows.go b/pkg/process/checks/process_windows.go index bb9d2eb7c6f3e..3fb6cdce2058a 100644 --- a/pkg/process/checks/process_windows.go +++ b/pkg/process/checks/process_windows.go @@ -11,7 +11,7 @@ import ( "math" "runtime" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" model "github.com/DataDog/agent-payload/v5/process" diff --git a/pkg/process/checks/process_windows_test.go b/pkg/process/checks/process_windows_test.go index b6c310ff3e580..b0eb246ee88bb 100644 --- a/pkg/process/checks/process_windows_test.go +++ b/pkg/process/checks/process_windows_test.go @@ -11,7 +11,7 @@ import ( "testing" model "github.com/DataDog/agent-payload/v5/process" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/stretchr/testify/assert" configmock "github.com/DataDog/datadog-agent/pkg/config/mock" diff --git a/pkg/process/checks/sysprobe_stats_test.go b/pkg/process/checks/sysprobe_stats_test.go index 2990b5bb7e957..9f7e315f2ebc6 100644 --- a/pkg/process/checks/sysprobe_stats_test.go +++ b/pkg/process/checks/sysprobe_stats_test.go @@ -6,14 +6,12 @@ package checks import ( - "fmt" "math/rand" "testing" "github.com/DataDog/agent-payload/v5/process" "github.com/stretchr/testify/assert" - netMocks "github.com/DataDog/datadog-agent/pkg/process/net/mocks" "github.com/DataDog/datadog-agent/pkg/process/procutil" ) @@ -46,12 +44,9 @@ func TestMergeProcWithSysprobeStats(t *testing.T) { proc1Stats := makeProcStatsWithPerm(1) proc2Stats := makeProcStatsWithPerm(2) - mockSysProbe := netMocks.NewSysProbeUtil(t) - mockSysProbe.On("GetProcStats", []int32{1, 2}).Return(&process.ProcStatsWithPermByPID{ + mergeProcWithSysprobeStats(map[int32]*procutil.Process{1: proc1, 2: proc2}, &process.ProcStatsWithPermByPID{ StatsByPID: map[int32]*process.ProcStatsWithPerm{1: proc1Stats, 2: proc2Stats}, - }, nil) - - mergeProcWithSysprobeStats([]int32{1, 2}, map[int32]*procutil.Process{1: proc1, 2: proc2}, mockSysProbe) + }) assertMatchesSysProbeStats(t, proc1, proc1Stats) assertMatchesSysProbeStats(t, proc2, proc2Stats) @@ -63,12 +58,9 @@ func TestMergeProcWithSysprobeStats(t *testing.T) { proc1Stats := makeProcStatsWithPerm(1) - mockSysProbe := netMocks.NewSysProbeUtil(t) - mockSysProbe.On("GetProcStats", []int32{1}).Return(&process.ProcStatsWithPermByPID{ + mergeProcWithSysprobeStats(map[int32]*procutil.Process{1: proc1, 2: proc2}, &process.ProcStatsWithPermByPID{ StatsByPID: map[int32]*process.ProcStatsWithPerm{1: proc1Stats}, - }, nil) - - mergeProcWithSysprobeStats([]int32{1}, map[int32]*procutil.Process{1: proc1, 2: proc2}, mockSysProbe) + }) assertMatchesSysProbeStats(t, proc1, proc1Stats) assert.False(t, hasSysProbeStats(proc2)) @@ -80,24 +72,10 @@ func TestMergeProcWithSysprobeStats(t *testing.T) { proc1Stats := makeProcStatsWithPerm(1) proc2Stats := makeProcStatsWithPerm(2) - mockSysProbe := netMocks.NewSysProbeUtil(t) - mockSysProbe.On("GetProcStats", []int32{1, 2}).Return(&process.ProcStatsWithPermByPID{ + mergeProcWithSysprobeStats(map[int32]*procutil.Process{2: proc2}, &process.ProcStatsWithPermByPID{ StatsByPID: map[int32]*process.ProcStatsWithPerm{1: proc1Stats, 2: proc2Stats}, - }, nil) - - mergeProcWithSysprobeStats([]int32{1, 2}, map[int32]*procutil.Process{2: proc2}, mockSysProbe) + }) assertMatchesSysProbeStats(t, proc2, proc2Stats) }) - - t.Run("error", func(t *testing.T) { - proc1 := makeProcess(1, "git clone google.com") - - mockSysProbe := netMocks.NewSysProbeUtil(t) - mockSysProbe.On("GetProcStats", []int32{1}).Return(nil, fmt.Errorf("catastrophic failure")) - - mergeProcWithSysprobeStats([]int32{1}, map[int32]*procutil.Process{1: proc1}, mockSysProbe) - - assert.False(t, hasSysProbeStats(proc1)) - }) } diff --git a/pkg/process/checks/system_info.go b/pkg/process/checks/system_info.go index bb187880b77b4..1f101e6ff5b7f 100644 --- a/pkg/process/checks/system_info.go +++ b/pkg/process/checks/system_info.go @@ -10,8 +10,8 @@ package checks import ( // waiting for upstream fix to platform collection in containerized environments "github.com/DataDog/gopsutil/host" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/mem" model "github.com/DataDog/agent-payload/v5/process" ) diff --git a/pkg/process/checks/system_info_darwin.go b/pkg/process/checks/system_info_darwin.go index 908df5428d5c8..065eec50b19fa 100644 --- a/pkg/process/checks/system_info_darwin.go +++ b/pkg/process/checks/system_info_darwin.go @@ -14,8 +14,8 @@ import ( // difference between methods for collecting macOS platform, kernel version // between shirou and Datadog psutil "github.com/DataDog/gopsutil/host" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/mem" "golang.org/x/sys/unix" ) diff --git a/pkg/process/checks/system_info_darwin_test.go b/pkg/process/checks/system_info_darwin_test.go index 264aae24a1868..d7bc8230b3df9 100644 --- a/pkg/process/checks/system_info_darwin_test.go +++ b/pkg/process/checks/system_info_darwin_test.go @@ -10,7 +10,7 @@ package checks import ( "testing" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/stretchr/testify/assert" ) diff --git a/pkg/process/net/common.go b/pkg/process/net/common.go index b9f1b787d52ad..83b1b603584fd 100644 --- a/pkg/process/net/common.go +++ b/pkg/process/net/common.go @@ -9,92 +9,20 @@ package net import ( "bytes" - "context" "fmt" - "io" - "net" "net/http" - "time" model "github.com/DataDog/agent-payload/v5/process" - netEncoding "github.com/DataDog/datadog-agent/pkg/network/encoding/unmarshal" - nppayload "github.com/DataDog/datadog-agent/pkg/networkpath/payload" + sysprobeclient "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" + sysconfig "github.com/DataDog/datadog-agent/cmd/system-probe/config" procEncoding "github.com/DataDog/datadog-agent/pkg/process/encoding" reqEncoding "github.com/DataDog/datadog-agent/pkg/process/encoding/request" pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/process" - "github.com/DataDog/datadog-agent/pkg/util/funcs" - "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/DataDog/datadog-agent/pkg/util/retry" ) -// Conn is a wrapper over some net.Listener -type Conn interface { - // GetListener returns the underlying net.Listener - GetListener() net.Listener - - // Stop and clean up resources for the underlying connection - Stop() -} - -const ( - contentTypeProtobuf = "application/protobuf" - contentTypeJSON = "application/json" -) - -var _ SysProbeUtil = &RemoteSysProbeUtil{} - -// RemoteSysProbeUtil wraps interactions with a remote system probe service -type RemoteSysProbeUtil struct { - // Retrier used to setup system probe - initRetry retry.Retrier - - path string - httpClient http.Client - tracerouteClient http.Client -} - -// ensure that GetRemoteSystemProbeUtil implements SysProbeUtilGetter -var _ SysProbeUtilGetter = GetRemoteSystemProbeUtil - -// GetRemoteSystemProbeUtil returns a ready to use RemoteSysProbeUtil. It is backed by a shared singleton. -func GetRemoteSystemProbeUtil(path string) (SysProbeUtil, error) { - sysProbeUtil, err := getRemoteSystemProbeUtil(path) - if err != nil { - return nil, err - } - - if err := sysProbeUtil.initRetry.TriggerRetry(); err != nil { - log.Debugf("system probe init error: %s", err) - return nil, err - } - - return sysProbeUtil, nil -} - -var getRemoteSystemProbeUtil = funcs.MemoizeArg(func(path string) (*RemoteSysProbeUtil, error) { - err := CheckPath(path) - if err != nil { - return nil, fmt.Errorf("error setting up remote system probe util, %v", err) - } - - sysProbeUtil := newSystemProbe(path) - err = sysProbeUtil.initRetry.SetupRetrier(&retry.Config{ //nolint:errcheck - Name: "system-probe-util", - AttemptMethod: sysProbeUtil.init, - Strategy: retry.RetryCount, - // 10 tries w/ 30s delays = 5m of trying before permafail - RetryCount: 10, - RetryDelay: 30 * time.Second, - }) - if err != nil { - return nil, err - } - return sysProbeUtil, nil -}) - // GetProcStats returns a set of process stats by querying system-probe -func (r *RemoteSysProbeUtil) GetProcStats(pids []int32) (*model.ProcStatsWithPermByPID, error) { +func GetProcStats(client *http.Client, pids []int32) (*model.ProcStatsWithPermByPID, error) { procReq := &pbgo.ProcessStatRequest{ Pids: pids, } @@ -104,24 +32,25 @@ func (r *RemoteSysProbeUtil) GetProcStats(pids []int32) (*model.ProcStatsWithPer return nil, err } - req, err := http.NewRequest("POST", procStatsURL, bytes.NewReader(reqBody)) + url := sysprobeclient.ModuleURL(sysconfig.ProcessModule, "/stats") + req, err := http.NewRequest("POST", url, bytes.NewReader(reqBody)) if err != nil { return nil, err } - req.Header.Set("Accept", contentTypeProtobuf) + req.Header.Set("Accept", procEncoding.ContentTypeProtobuf) req.Header.Set("Content-Type", procEncoding.ContentTypeProtobuf) - resp, err := r.httpClient.Do(req) + resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("proc_stats request failed: Probe Path %s, url: %s, status code: %d", r.path, procStatsURL, resp.StatusCode) + return nil, fmt.Errorf("proc_stats request failed: url: %s, status code: %d", req.URL, resp.StatusCode) } - body, err := readAllResponseBody(resp) + body, err := sysprobeclient.ReadAllResponseBody(resp) if err != nil { return nil, err } @@ -135,180 +64,29 @@ func (r *RemoteSysProbeUtil) GetProcStats(pids []int32) (*model.ProcStatsWithPer return results, nil } -// GetConnections returns a set of active network connections, retrieved from the system probe service -func (r *RemoteSysProbeUtil) GetConnections(clientID string) (*model.Connections, error) { - req, err := http.NewRequest("GET", fmt.Sprintf("%s?client_id=%s", connectionsURL, clientID), nil) - if err != nil { - return nil, err - } - - req.Header.Set("Accept", contentTypeProtobuf) - resp, err := r.httpClient.Do(req) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("conn request failed: Probe Path %s, url: %s, status code: %d", r.path, connectionsURL, resp.StatusCode) - } - - body, err := readAllResponseBody(resp) - if err != nil { - return nil, err - } - - contentType := resp.Header.Get("Content-type") - conns, err := netEncoding.GetUnmarshaler(contentType).Unmarshal(body) - if err != nil { - return nil, err - } - - return conns, nil -} - // GetNetworkID fetches the network_id (vpc_id) from system-probe -func (r *RemoteSysProbeUtil) GetNetworkID() (string, error) { - req, err := http.NewRequest("GET", networkIDURL, nil) +func GetNetworkID(client *http.Client) (string, error) { + url := sysprobeclient.ModuleURL(sysconfig.NetworkTracerModule, "/network_id") + req, err := http.NewRequest("GET", url, nil) if err != nil { return "", fmt.Errorf("failed to create request: %w", err) } req.Header.Set("Accept", "text/plain") - resp, err := r.httpClient.Do(req) + resp, err := client.Do(req) if err != nil { return "", fmt.Errorf("failed to execute request: %w", err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("network_id request failed: url: %s, status code: %d", networkIDURL, resp.StatusCode) + return "", fmt.Errorf("network_id request failed: url: %s, status code: %d", req.URL, resp.StatusCode) } - body, err := readAllResponseBody(resp) + body, err := sysprobeclient.ReadAllResponseBody(resp) if err != nil { return "", fmt.Errorf("failed to read response body: %w", err) } return string(body), nil } - -// GetPing returns the results of a ping to a host -func (r *RemoteSysProbeUtil) GetPing(clientID string, host string, count int, interval time.Duration, timeout time.Duration) ([]byte, error) { - req, err := http.NewRequest("GET", fmt.Sprintf("%s/%s?client_id=%s&count=%d&interval=%d&timeout=%d", pingURL, host, clientID, count, interval, timeout), nil) - if err != nil { - return nil, err - } - - req.Header.Set("Accept", contentTypeJSON) - resp, err := r.httpClient.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode == http.StatusBadRequest { - body, err := readAllResponseBody(resp) - if err != nil { - return nil, fmt.Errorf("ping request failed: Probe Path %s, url: %s, status code: %d", r.path, pingURL, resp.StatusCode) - } - return nil, fmt.Errorf("ping request failed: Probe Path %s, url: %s, status code: %d, error: %s", r.path, pingURL, resp.StatusCode, string(body)) - } else if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("ping request failed: Probe Path %s, url: %s, status code: %d", r.path, pingURL, resp.StatusCode) - } - - body, err := readAllResponseBody(resp) - if err != nil { - return nil, err - } - - return body, nil -} - -// GetTraceroute returns the results of a traceroute to a host -func (r *RemoteSysProbeUtil) GetTraceroute(clientID string, host string, port uint16, protocol nppayload.Protocol, maxTTL uint8, timeout time.Duration) ([]byte, error) { - httpTimeout := timeout*time.Duration(maxTTL) + 10*time.Second // allow extra time for the system probe communication overhead, calculate full timeout for TCP traceroute - log.Tracef("Network Path traceroute HTTP request timeout: %s", httpTimeout) - ctx, cancel := context.WithTimeout(context.Background(), httpTimeout) - defer cancel() - - req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("%s/%s?client_id=%s&port=%d&max_ttl=%d&timeout=%d&protocol=%s", tracerouteURL, host, clientID, port, maxTTL, timeout, protocol), nil) - if err != nil { - return nil, err - } - - req.Header.Set("Accept", contentTypeJSON) - resp, err := r.tracerouteClient.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode == http.StatusBadRequest { - body, err := readAllResponseBody(resp) - if err != nil { - return nil, fmt.Errorf("traceroute request failed: Probe Path %s, url: %s, status code: %d", r.path, tracerouteURL, resp.StatusCode) - } - return nil, fmt.Errorf("traceroute request failed: Probe Path %s, url: %s, status code: %d, error: %s", r.path, tracerouteURL, resp.StatusCode, string(body)) - } else if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("traceroute request failed: Probe Path %s, url: %s, status code: %d", r.path, tracerouteURL, resp.StatusCode) - } - - body, err := readAllResponseBody(resp) - if err != nil { - return nil, err - } - - return body, nil -} - -// Register registers the client to system probe -func (r *RemoteSysProbeUtil) Register(clientID string) error { - req, err := http.NewRequest("GET", fmt.Sprintf("%s?client_id=%s", registerURL, clientID), nil) - if err != nil { - return err - } - - resp, err := r.httpClient.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("conn request failed: Path %s, url: %s, status code: %d", r.path, statsURL, resp.StatusCode) - } - - return nil -} - -func (r *RemoteSysProbeUtil) init() error { - resp, err := r.httpClient.Get(statsURL) - if err != nil { - return err - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("remote tracer status check failed: socket %s, url: %s, status code: %d", r.path, statsURL, resp.StatusCode) - } - return nil -} - -func readAllResponseBody(resp *http.Response) ([]byte, error) { - // if we are not able to determine the content length - // we read the whole body without pre-allocation - if resp.ContentLength <= 0 { - return io.ReadAll(resp.Body) - } - - // if we know the content length we pre-allocate the buffer - var buf bytes.Buffer - buf.Grow(int(resp.ContentLength)) - - _, err := buf.ReadFrom(resp.Body) - if err != nil { - return nil, err - } - - return buf.Bytes(), nil -} diff --git a/pkg/process/net/common_all.go b/pkg/process/net/common_all.go index 9dee717e7b6bb..1e1cc1fcb17a1 100644 --- a/pkg/process/net/common_all.go +++ b/pkg/process/net/common_all.go @@ -1,14 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed // under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. +// Copyright 2024-present Datadog, Inc. // Package net provides local access to system probe package net - -import "errors" - -var ( - // ErrNotImplemented is an error used when system-probe is attempted to be accessed on an unsupported OS - ErrNotImplemented = errors.New("system-probe unsupported") -) diff --git a/pkg/process/net/common_linux.go b/pkg/process/net/common_linux.go deleted file mode 100644 index 3529180ba9576..0000000000000 --- a/pkg/process/net/common_linux.go +++ /dev/null @@ -1,56 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -//go:build linux - -package net - -import ( - "errors" - "fmt" - "net/http" - "os" - - "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" - sysconfig "github.com/DataDog/datadog-agent/cmd/system-probe/config" -) - -const ( - pingURL = "http://unix/" + string(sysconfig.PingModule) + "/ping/" - tracerouteURL = "http://unix/" + string(sysconfig.TracerouteModule) + "/traceroute/" - connectionsURL = "http://unix/" + string(sysconfig.NetworkTracerModule) + "/connections" - networkIDURL = "http://unix/" + string(sysconfig.NetworkTracerModule) + "/network_id" - procStatsURL = "http://unix/" + string(sysconfig.ProcessModule) + "/stats" - registerURL = "http://unix/" + string(sysconfig.NetworkTracerModule) + "/register" - statsURL = "http://unix/debug/stats" -) - -// CheckPath is used in conjunction with calling the stats endpoint, since we are calling this -// From the main agent and want to ensure the socket exists -func CheckPath(path string) error { - if path == "" { - return errors.New("socket path is empty") - } - - if _, err := os.Stat(path); err != nil { - return fmt.Errorf("socket path does not exist: %v", err) - } - return nil -} - -// newSystemProbe creates a group of clients to interact with system-probe. -func newSystemProbe(path string) *RemoteSysProbeUtil { - return &RemoteSysProbeUtil{ - path: path, - httpClient: *client.Get(path), - tracerouteClient: http.Client{ - // no timeout set here, the expected usage of this client - // is that the caller will set a timeout on each request - Transport: &http.Transport{ - DialContext: client.DialContextFunc(path), - }, - }, - } -} diff --git a/pkg/process/net/common_unsupported.go b/pkg/process/net/common_unsupported.go index c4354fce03fd9..c145137a3a0af 100644 --- a/pkg/process/net/common_unsupported.go +++ b/pkg/process/net/common_unsupported.go @@ -1,72 +1,25 @@ // Unless explicitly stated otherwise all files in this repository are licensed // under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. +// Copyright 2024-present Datadog, Inc. //go:build !linux && !windows package net import ( - "time" + "errors" + "net/http" model "github.com/DataDog/agent-payload/v5/process" - - nppayload "github.com/DataDog/datadog-agent/pkg/networkpath/payload" ) -var _ SysProbeUtil = &RemoteSysProbeUtil{} -var _ SysProbeUtilGetter = GetRemoteSystemProbeUtil - -// RemoteSysProbeUtil is not supported -type RemoteSysProbeUtil struct{} - -// CheckPath is not supported -// -//nolint:revive // TODO(PROC) Fix revive linter -func CheckPath(_ string) error { - return ErrNotImplemented -} - -// GetRemoteSystemProbeUtil is not supported -// -//nolint:revive // TODO(PROC) Fix revive linter -func GetRemoteSystemProbeUtil(_ string) (SysProbeUtil, error) { - return &RemoteSysProbeUtil{}, ErrNotImplemented -} - -// GetConnections is not supported -// -//nolint:revive // TODO(PROC) Fix revive linter -func (r *RemoteSysProbeUtil) GetConnections(_ string) (*model.Connections, error) { - return nil, ErrNotImplemented -} - -// GetNetworkID is not supported -func (r *RemoteSysProbeUtil) GetNetworkID() (string, error) { - return "", ErrNotImplemented -} - -// GetProcStats is not supported -// -//nolint:revive // TODO(PROC) Fix revive linter -func (r *RemoteSysProbeUtil) GetProcStats(_ []int32) (*model.ProcStatsWithPermByPID, error) { - return nil, ErrNotImplemented -} - -// Register is not supported -// -//nolint:revive // TODO(PROC) Fix revive linter -func (r *RemoteSysProbeUtil) Register(_ string) error { - return ErrNotImplemented -} - -// GetPing is not supported -func (r *RemoteSysProbeUtil) GetPing(_ string, _ string, _ int, _ time.Duration, _ time.Duration) ([]byte, error) { - return nil, ErrNotImplemented +// GetProcStats returns a set of process stats by querying system-probe +func GetProcStats(_ *http.Client, _ []int32) (*model.ProcStatsWithPermByPID, error) { + return nil, errors.New("unsupported platform") } -// GetTraceroute is not supported -func (r *RemoteSysProbeUtil) GetTraceroute(_ string, _ string, _ uint16, _ nppayload.Protocol, _ uint8, _ time.Duration) ([]byte, error) { - return nil, ErrNotImplemented +// GetNetworkID fetches the network_id (vpc_id) from system-probe +func GetNetworkID(_ *http.Client) (string, error) { + return "", errors.New("unsupported platform") } diff --git a/pkg/process/net/common_windows.go b/pkg/process/net/common_windows.go deleted file mode 100644 index 7a08bca481b93..0000000000000 --- a/pkg/process/net/common_windows.go +++ /dev/null @@ -1,63 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -//go:build windows - -package net - -import ( - "errors" - "net/http" - "time" - - "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" - sysconfig "github.com/DataDog/datadog-agent/cmd/system-probe/config" -) - -const ( - connectionsURL = "http://localhost:3333/" + string(sysconfig.NetworkTracerModule) + "/connections" - networkIDURL = "http://unix/" + string(sysconfig.NetworkTracerModule) + "/network_id" - registerURL = "http://localhost:3333/" + string(sysconfig.NetworkTracerModule) + "/register" - statsURL = "http://localhost:3333/debug/stats" - tracerouteURL = "http://localhost:3333/" + string(sysconfig.TracerouteModule) + "/traceroute/" - - // procStatsURL is not used in windows, the value is added to avoid compilation error in windows - procStatsURL = "http://localhost:3333/" + string(sysconfig.ProcessModule) + "stats" - // pingURL is not used in windows, the value is added to avoid compilation error in windows - pingURL = "http://localhost:3333/" + string(sysconfig.PingModule) + "/ping/" - - // systemProbeMaxIdleConns sets the maximum number of idle named pipe connections. - systemProbeMaxIdleConns = 2 - - // systemProbeIdleConnTimeout is the time a named pipe connection is held up idle before being closed. - // This should be small since connections are local, to close them as soon as they are done, - // and to quickly service new pending connections. - systemProbeIdleConnTimeout = 5 * time.Second -) - -// CheckPath is used to make sure the globalSocketPath has been set before attempting to connect -func CheckPath(path string) error { - if path == "" { - return errors.New("socket path is empty") - } - return nil -} - -// newSystemProbe creates a group of clients to interact with system-probe. -func newSystemProbe(path string) *RemoteSysProbeUtil { - return &RemoteSysProbeUtil{ - path: path, - httpClient: *client.Get(path), - tracerouteClient: http.Client{ - // no timeout set here, the expected usage of this client - // is that the caller will set a timeout on each request - Transport: &http.Transport{ - MaxIdleConns: systemProbeMaxIdleConns, - IdleConnTimeout: systemProbeIdleConnTimeout, - DialContext: client.DialContextFunc(path), - }, - }, - } -} diff --git a/pkg/process/net/mocks/sys_probe_util.go b/pkg/process/net/mocks/sys_probe_util.go deleted file mode 100644 index 00c03f639df65..0000000000000 --- a/pkg/process/net/mocks/sys_probe_util.go +++ /dev/null @@ -1,382 +0,0 @@ -// Code generated by mockery v2.49.2. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - - payload "github.com/DataDog/datadog-agent/pkg/networkpath/payload" - - process "github.com/DataDog/agent-payload/v5/process" - - time "time" -) - -// SysProbeUtil is an autogenerated mock type for the SysProbeUtil type -type SysProbeUtil struct { - mock.Mock -} - -type SysProbeUtil_Expecter struct { - mock *mock.Mock -} - -func (_m *SysProbeUtil) EXPECT() *SysProbeUtil_Expecter { - return &SysProbeUtil_Expecter{mock: &_m.Mock} -} - -// GetConnections provides a mock function with given fields: clientID -func (_m *SysProbeUtil) GetConnections(clientID string) (*process.Connections, error) { - ret := _m.Called(clientID) - - if len(ret) == 0 { - panic("no return value specified for GetConnections") - } - - var r0 *process.Connections - var r1 error - if rf, ok := ret.Get(0).(func(string) (*process.Connections, error)); ok { - return rf(clientID) - } - if rf, ok := ret.Get(0).(func(string) *process.Connections); ok { - r0 = rf(clientID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*process.Connections) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(clientID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SysProbeUtil_GetConnections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConnections' -type SysProbeUtil_GetConnections_Call struct { - *mock.Call -} - -// GetConnections is a helper method to define mock.On call -// - clientID string -func (_e *SysProbeUtil_Expecter) GetConnections(clientID interface{}) *SysProbeUtil_GetConnections_Call { - return &SysProbeUtil_GetConnections_Call{Call: _e.mock.On("GetConnections", clientID)} -} - -func (_c *SysProbeUtil_GetConnections_Call) Run(run func(clientID string)) *SysProbeUtil_GetConnections_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *SysProbeUtil_GetConnections_Call) Return(_a0 *process.Connections, _a1 error) *SysProbeUtil_GetConnections_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *SysProbeUtil_GetConnections_Call) RunAndReturn(run func(string) (*process.Connections, error)) *SysProbeUtil_GetConnections_Call { - _c.Call.Return(run) - return _c -} - -// GetNetworkID provides a mock function with no fields -func (_m *SysProbeUtil) GetNetworkID() (string, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNetworkID") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func() (string, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SysProbeUtil_GetNetworkID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNetworkID' -type SysProbeUtil_GetNetworkID_Call struct { - *mock.Call -} - -// GetNetworkID is a helper method to define mock.On call -func (_e *SysProbeUtil_Expecter) GetNetworkID() *SysProbeUtil_GetNetworkID_Call { - return &SysProbeUtil_GetNetworkID_Call{Call: _e.mock.On("GetNetworkID")} -} - -func (_c *SysProbeUtil_GetNetworkID_Call) Run(run func()) *SysProbeUtil_GetNetworkID_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *SysProbeUtil_GetNetworkID_Call) Return(_a0 string, _a1 error) *SysProbeUtil_GetNetworkID_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *SysProbeUtil_GetNetworkID_Call) RunAndReturn(run func() (string, error)) *SysProbeUtil_GetNetworkID_Call { - _c.Call.Return(run) - return _c -} - -// GetPing provides a mock function with given fields: clientID, host, count, interval, timeout -func (_m *SysProbeUtil) GetPing(clientID string, host string, count int, interval time.Duration, timeout time.Duration) ([]byte, error) { - ret := _m.Called(clientID, host, count, interval, timeout) - - if len(ret) == 0 { - panic("no return value specified for GetPing") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(string, string, int, time.Duration, time.Duration) ([]byte, error)); ok { - return rf(clientID, host, count, interval, timeout) - } - if rf, ok := ret.Get(0).(func(string, string, int, time.Duration, time.Duration) []byte); ok { - r0 = rf(clientID, host, count, interval, timeout) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(string, string, int, time.Duration, time.Duration) error); ok { - r1 = rf(clientID, host, count, interval, timeout) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SysProbeUtil_GetPing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPing' -type SysProbeUtil_GetPing_Call struct { - *mock.Call -} - -// GetPing is a helper method to define mock.On call -// - clientID string -// - host string -// - count int -// - interval time.Duration -// - timeout time.Duration -func (_e *SysProbeUtil_Expecter) GetPing(clientID interface{}, host interface{}, count interface{}, interval interface{}, timeout interface{}) *SysProbeUtil_GetPing_Call { - return &SysProbeUtil_GetPing_Call{Call: _e.mock.On("GetPing", clientID, host, count, interval, timeout)} -} - -func (_c *SysProbeUtil_GetPing_Call) Run(run func(clientID string, host string, count int, interval time.Duration, timeout time.Duration)) *SysProbeUtil_GetPing_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string), args[2].(int), args[3].(time.Duration), args[4].(time.Duration)) - }) - return _c -} - -func (_c *SysProbeUtil_GetPing_Call) Return(_a0 []byte, _a1 error) *SysProbeUtil_GetPing_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *SysProbeUtil_GetPing_Call) RunAndReturn(run func(string, string, int, time.Duration, time.Duration) ([]byte, error)) *SysProbeUtil_GetPing_Call { - _c.Call.Return(run) - return _c -} - -// GetProcStats provides a mock function with given fields: pids -func (_m *SysProbeUtil) GetProcStats(pids []int32) (*process.ProcStatsWithPermByPID, error) { - ret := _m.Called(pids) - - if len(ret) == 0 { - panic("no return value specified for GetProcStats") - } - - var r0 *process.ProcStatsWithPermByPID - var r1 error - if rf, ok := ret.Get(0).(func([]int32) (*process.ProcStatsWithPermByPID, error)); ok { - return rf(pids) - } - if rf, ok := ret.Get(0).(func([]int32) *process.ProcStatsWithPermByPID); ok { - r0 = rf(pids) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*process.ProcStatsWithPermByPID) - } - } - - if rf, ok := ret.Get(1).(func([]int32) error); ok { - r1 = rf(pids) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SysProbeUtil_GetProcStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProcStats' -type SysProbeUtil_GetProcStats_Call struct { - *mock.Call -} - -// GetProcStats is a helper method to define mock.On call -// - pids []int32 -func (_e *SysProbeUtil_Expecter) GetProcStats(pids interface{}) *SysProbeUtil_GetProcStats_Call { - return &SysProbeUtil_GetProcStats_Call{Call: _e.mock.On("GetProcStats", pids)} -} - -func (_c *SysProbeUtil_GetProcStats_Call) Run(run func(pids []int32)) *SysProbeUtil_GetProcStats_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]int32)) - }) - return _c -} - -func (_c *SysProbeUtil_GetProcStats_Call) Return(_a0 *process.ProcStatsWithPermByPID, _a1 error) *SysProbeUtil_GetProcStats_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *SysProbeUtil_GetProcStats_Call) RunAndReturn(run func([]int32) (*process.ProcStatsWithPermByPID, error)) *SysProbeUtil_GetProcStats_Call { - _c.Call.Return(run) - return _c -} - -// GetTraceroute provides a mock function with given fields: clientID, host, port, protocol, maxTTL, timeout -func (_m *SysProbeUtil) GetTraceroute(clientID string, host string, port uint16, protocol payload.Protocol, maxTTL uint8, timeout time.Duration) ([]byte, error) { - ret := _m.Called(clientID, host, port, protocol, maxTTL, timeout) - - if len(ret) == 0 { - panic("no return value specified for GetTraceroute") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(string, string, uint16, payload.Protocol, uint8, time.Duration) ([]byte, error)); ok { - return rf(clientID, host, port, protocol, maxTTL, timeout) - } - if rf, ok := ret.Get(0).(func(string, string, uint16, payload.Protocol, uint8, time.Duration) []byte); ok { - r0 = rf(clientID, host, port, protocol, maxTTL, timeout) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(string, string, uint16, payload.Protocol, uint8, time.Duration) error); ok { - r1 = rf(clientID, host, port, protocol, maxTTL, timeout) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SysProbeUtil_GetTraceroute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTraceroute' -type SysProbeUtil_GetTraceroute_Call struct { - *mock.Call -} - -// GetTraceroute is a helper method to define mock.On call -// - clientID string -// - host string -// - port uint16 -// - protocol payload.Protocol -// - maxTTL uint8 -// - timeout time.Duration -func (_e *SysProbeUtil_Expecter) GetTraceroute(clientID interface{}, host interface{}, port interface{}, protocol interface{}, maxTTL interface{}, timeout interface{}) *SysProbeUtil_GetTraceroute_Call { - return &SysProbeUtil_GetTraceroute_Call{Call: _e.mock.On("GetTraceroute", clientID, host, port, protocol, maxTTL, timeout)} -} - -func (_c *SysProbeUtil_GetTraceroute_Call) Run(run func(clientID string, host string, port uint16, protocol payload.Protocol, maxTTL uint8, timeout time.Duration)) *SysProbeUtil_GetTraceroute_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(string), args[2].(uint16), args[3].(payload.Protocol), args[4].(uint8), args[5].(time.Duration)) - }) - return _c -} - -func (_c *SysProbeUtil_GetTraceroute_Call) Return(_a0 []byte, _a1 error) *SysProbeUtil_GetTraceroute_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *SysProbeUtil_GetTraceroute_Call) RunAndReturn(run func(string, string, uint16, payload.Protocol, uint8, time.Duration) ([]byte, error)) *SysProbeUtil_GetTraceroute_Call { - _c.Call.Return(run) - return _c -} - -// Register provides a mock function with given fields: clientID -func (_m *SysProbeUtil) Register(clientID string) error { - ret := _m.Called(clientID) - - if len(ret) == 0 { - panic("no return value specified for Register") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(clientID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SysProbeUtil_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' -type SysProbeUtil_Register_Call struct { - *mock.Call -} - -// Register is a helper method to define mock.On call -// - clientID string -func (_e *SysProbeUtil_Expecter) Register(clientID interface{}) *SysProbeUtil_Register_Call { - return &SysProbeUtil_Register_Call{Call: _e.mock.On("Register", clientID)} -} - -func (_c *SysProbeUtil_Register_Call) Run(run func(clientID string)) *SysProbeUtil_Register_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *SysProbeUtil_Register_Call) Return(_a0 error) *SysProbeUtil_Register_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *SysProbeUtil_Register_Call) RunAndReturn(run func(string) error) *SysProbeUtil_Register_Call { - _c.Call.Return(run) - return _c -} - -// NewSysProbeUtil creates a new instance of SysProbeUtil. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSysProbeUtil(t interface { - mock.TestingT - Cleanup(func()) -}) *SysProbeUtil { - mock := &SysProbeUtil{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/process/net/shared.go b/pkg/process/net/shared.go deleted file mode 100644 index 33ca74d07863d..0000000000000 --- a/pkg/process/net/shared.go +++ /dev/null @@ -1,28 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -package net - -import ( - "time" - - model "github.com/DataDog/agent-payload/v5/process" - - nppayload "github.com/DataDog/datadog-agent/pkg/networkpath/payload" -) - -// SysProbeUtilGetter is a function that returns a SysProbeUtil for the given path -// The standard implementation is GetRemoteSysProbeUtil -type SysProbeUtilGetter func(string) (SysProbeUtil, error) - -// SysProbeUtil fetches info from the SysProbe running remotely -type SysProbeUtil interface { - GetConnections(clientID string) (*model.Connections, error) - GetProcStats(pids []int32) (*model.ProcStatsWithPermByPID, error) - Register(clientID string) error - GetNetworkID() (string, error) - GetPing(clientID string, host string, count int, interval time.Duration, timeout time.Duration) ([]byte, error) - GetTraceroute(clientID string, host string, port uint16, protocol nppayload.Protocol, maxTTL uint8, timeout time.Duration) ([]byte, error) -} diff --git a/pkg/process/procutil/process_windows_toolhelp.go b/pkg/process/procutil/process_windows_toolhelp.go index e96b9aabebb78..204496f30701c 100644 --- a/pkg/process/procutil/process_windows_toolhelp.go +++ b/pkg/process/procutil/process_windows_toolhelp.go @@ -16,7 +16,7 @@ import ( "github.com/shirou/w32" "golang.org/x/sys/windows" - process "github.com/shirou/gopsutil/v3/process" + process "github.com/shirou/gopsutil/v4/process" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/winutil" diff --git a/pkg/sbom/collectors/host/host_wmi.go b/pkg/sbom/collectors/host/host_wmi.go index 6af66de787354..937e2823dad90 100644 --- a/pkg/sbom/collectors/host/host_wmi.go +++ b/pkg/sbom/collectors/host/host_wmi.go @@ -21,7 +21,7 @@ import ( "github.com/DataDog/gopsutil/host" cyclonedxgo "github.com/CycloneDX/cyclonedx-go" - host2 "github.com/shirou/gopsutil/v3/host" + host2 "github.com/shirou/gopsutil/v4/host" "github.com/yusufpapurcu/wmi" ) diff --git a/pkg/security/probe/monitors/runtime/runtime_monitor.go b/pkg/security/probe/monitors/runtime/runtime_monitor.go index 403cba55e8052..8f0d3511def76 100644 --- a/pkg/security/probe/monitors/runtime/runtime_monitor.go +++ b/pkg/security/probe/monitors/runtime/runtime_monitor.go @@ -14,7 +14,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/DataDog/datadog-go/v5/statsd" diff --git a/pkg/security/probe/probe_linux.go b/pkg/security/probe/probe_linux.go index 83c2c4800215d..b4b557db19aea 100644 --- a/pkg/security/probe/probe_linux.go +++ b/pkg/security/probe/probe_linux.go @@ -11,7 +11,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/ebpf/kernel" "github.com/DataDog/datadog-agent/pkg/security/events" "github.com/DataDog/datadog-agent/pkg/security/utils" - gopsutilProcess "github.com/shirou/gopsutil/v3/process" + gopsutilProcess "github.com/shirou/gopsutil/v4/process" ) const ( diff --git a/pkg/security/probe/process_killer_linux.go b/pkg/security/probe/process_killer_linux.go index 6586399fa8585..0d038f62b44a2 100644 --- a/pkg/security/probe/process_killer_linux.go +++ b/pkg/security/probe/process_killer_linux.go @@ -11,7 +11,7 @@ import ( "fmt" "syscall" - psutil "github.com/shirou/gopsutil/v3/process" + psutil "github.com/shirou/gopsutil/v4/process" "github.com/DataDog/datadog-agent/pkg/security/secl/model" ) diff --git a/pkg/security/ptracer/proc.go b/pkg/security/ptracer/proc.go index 0484449f2ac94..8a435e4599534 100644 --- a/pkg/security/ptracer/proc.go +++ b/pkg/security/ptracer/proc.go @@ -16,7 +16,7 @@ import ( "strings" "time" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "github.com/DataDog/datadog-agent/pkg/security/proto/ebpfless" ) diff --git a/pkg/security/resolvers/cgroup/resolver.go b/pkg/security/resolvers/cgroup/resolver.go index 825d7cc92cf42..2137cccf14506 100644 --- a/pkg/security/resolvers/cgroup/resolver.go +++ b/pkg/security/resolvers/cgroup/resolver.go @@ -47,8 +47,9 @@ type ResolverInterface interface { // Resolver defines a cgroup monitor type Resolver struct { *utils.Notifier[Event, *cgroupModel.CacheEntry] - sync.RWMutex - workloads *simplelru.LRU[containerutils.CGroupID, *cgroupModel.CacheEntry] + sync.Mutex + hostWorkloads *simplelru.LRU[containerutils.CGroupID, *cgroupModel.CacheEntry] + containerWorkloads *simplelru.LRU[containerutils.ContainerID, *cgroupModel.CacheEntry] } // NewResolver returns a new cgroups monitor @@ -56,16 +57,29 @@ func NewResolver() (*Resolver, error) { cr := &Resolver{ Notifier: utils.NewNotifier[Event, *cgroupModel.CacheEntry](), } - workloads, err := simplelru.NewLRU(1024, func(_ containerutils.CGroupID, value *cgroupModel.CacheEntry) { + + cleanup := func(value *cgroupModel.CacheEntry) { value.CallReleaseCallback() value.Deleted.Store(true) cr.NotifyListeners(CGroupDeleted, value) + } + + var err error + cr.hostWorkloads, err = simplelru.NewLRU(1024, func(_ containerutils.CGroupID, value *cgroupModel.CacheEntry) { + cleanup(value) + }) + if err != nil { + return nil, err + } + + cr.containerWorkloads, err = simplelru.NewLRU(1024, func(_ containerutils.ContainerID, value *cgroupModel.CacheEntry) { + cleanup(value) }) if err != nil { return nil, err } - cr.workloads = workloads + return cr, nil } @@ -78,7 +92,15 @@ func (cr *Resolver) AddPID(process *model.ProcessCacheEntry) { cr.Lock() defer cr.Unlock() - entry, exists := cr.workloads.Get(process.CGroup.CGroupID) + if process.ContainerID != "" { + entry, exists := cr.containerWorkloads.Get(process.ContainerID) + if exists { + entry.AddPID(process.Pid) + return + } + } + + entry, exists := cr.hostWorkloads.Get(process.CGroup.CGroupID) if exists { entry.AddPID(process.Pid) return @@ -94,33 +116,25 @@ func (cr *Resolver) AddPID(process *model.ProcessCacheEntry) { newCGroup.CreatedAt = uint64(process.ProcessContext.ExecTime.UnixNano()) // add the new CGroup to the cache - cr.workloads.Add(process.CGroup.CGroupID, newCGroup) + if process.ContainerID != "" { + cr.containerWorkloads.Add(process.ContainerID, newCGroup) + } else { + cr.hostWorkloads.Add(process.CGroup.CGroupID, newCGroup) + } cr.NotifyListeners(CGroupCreated, newCGroup) } -// Get returns the workload referenced by the provided ID -func (cr *Resolver) Get(id containerutils.CGroupID) (*cgroupModel.CacheEntry, bool) { - cr.RLock() - defer cr.RUnlock() - - return cr.workloads.Get(id) -} - // GetWorkload returns the workload referenced by the provided ID func (cr *Resolver) GetWorkload(id containerutils.ContainerID) (*cgroupModel.CacheEntry, bool) { - cr.RLock() - defer cr.RUnlock() - - if id != "" { - for _, workload := range cr.workloads.Values() { - if workload.ContainerID == id { - return workload, true - } - } + if id == "" { + return nil, false } - return nil, false + cr.Lock() + defer cr.Unlock() + + return cr.containerWorkloads.Get(id) } // DelPID removes a PID from the cgroup resolver @@ -128,7 +142,11 @@ func (cr *Resolver) DelPID(pid uint32) { cr.Lock() defer cr.Unlock() - for _, workload := range cr.workloads.Values() { + for _, workload := range cr.containerWorkloads.Values() { + cr.deleteWorkloadPID(pid, workload) + } + + for _, workload := range cr.hostWorkloads.Values() { cr.deleteWorkloadPID(pid, workload) } } @@ -138,11 +156,9 @@ func (cr *Resolver) DelPIDWithID(id containerutils.ContainerID, pid uint32) { cr.Lock() defer cr.Unlock() - for _, workload := range cr.workloads.Values() { - if workload.ContainerID == id { - cr.deleteWorkloadPID(pid, workload) - return - } + entry, exists := cr.containerWorkloads.Get(id) + if exists { + cr.deleteWorkloadPID(pid, entry) } } @@ -155,14 +171,17 @@ func (cr *Resolver) deleteWorkloadPID(pid uint32, workload *cgroupModel.CacheEnt // check if the workload should be deleted if len(workload.PIDs) <= 0 { - cr.workloads.Remove(workload.CGroupID) + cr.hostWorkloads.Remove(workload.CGroupID) + if workload.ContainerID != "" { + cr.containerWorkloads.Remove(workload.ContainerID) + } } } // Len return the number of entries func (cr *Resolver) Len() int { - cr.RLock() - defer cr.RUnlock() + cr.Lock() + defer cr.Unlock() - return cr.workloads.Len() + return cr.hostWorkloads.Len() + cr.containerWorkloads.Len() } diff --git a/pkg/security/resolvers/process/resolver_ebpf.go b/pkg/security/resolvers/process/resolver_ebpf.go index c9a3fd4f8ad7e..dc5694dd55647 100644 --- a/pkg/security/resolvers/process/resolver_ebpf.go +++ b/pkg/security/resolvers/process/resolver_ebpf.go @@ -26,7 +26,7 @@ import ( manager "github.com/DataDog/ebpf-manager" lib "github.com/cilium/ebpf" "github.com/hashicorp/golang-lru/v2/simplelru" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "go.uber.org/atomic" "github.com/DataDog/datadog-agent/pkg/process/procutil" @@ -384,14 +384,14 @@ func (p *EBPFResolver) enrichEventFromProc(entry *model.ProcessCacheEntry, proc entry.ProcessContext.Pid = pid entry.ProcessContext.Tid = pid if len(filledProc.Uids) >= 4 { - entry.Credentials.UID = uint32(filledProc.Uids[0]) - entry.Credentials.EUID = uint32(filledProc.Uids[1]) - entry.Credentials.FSUID = uint32(filledProc.Uids[3]) + entry.Credentials.UID = filledProc.Uids[0] + entry.Credentials.EUID = filledProc.Uids[1] + entry.Credentials.FSUID = filledProc.Uids[3] } if len(filledProc.Gids) >= 4 { - entry.Credentials.GID = uint32(filledProc.Gids[0]) - entry.Credentials.EGID = uint32(filledProc.Gids[1]) - entry.Credentials.FSGID = uint32(filledProc.Gids[3]) + entry.Credentials.GID = filledProc.Gids[0] + entry.Credentials.EGID = filledProc.Gids[1] + entry.Credentials.FSGID = filledProc.Gids[3] } // fetch login_uid entry.Credentials.AUID, err = utils.GetLoginUID(uint32(proc.Pid)) diff --git a/pkg/security/security_profile/activity_tree/process_node_snapshot.go b/pkg/security/security_profile/activity_tree/process_node_snapshot.go index aea6151f018e2..bd5cb069083b4 100644 --- a/pkg/security/security_profile/activity_tree/process_node_snapshot.go +++ b/pkg/security/security_profile/activity_tree/process_node_snapshot.go @@ -23,7 +23,7 @@ import ( "time" "github.com/prometheus/procfs" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" "golang.org/x/sys/unix" "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" diff --git a/pkg/security/utils/numcpu.go b/pkg/security/utils/numcpu.go index b6e7506a3c351..7f488e739d166 100644 --- a/pkg/security/utils/numcpu.go +++ b/pkg/security/utils/numcpu.go @@ -9,7 +9,7 @@ package utils import ( - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" ) // NumCPU returns the count of CPUs in the CPU affinity mask of the pid 1 process diff --git a/pkg/security/utils/proc_common.go b/pkg/security/utils/proc_common.go index 755221d676f20..2b5542a28f8b8 100644 --- a/pkg/security/utils/proc_common.go +++ b/pkg/security/utils/proc_common.go @@ -7,7 +7,7 @@ package utils import ( - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" ) // GetProcesses returns list of active processes @@ -37,8 +37,8 @@ type FilledProcess struct { Ppid int32 CreateTime int64 Name string - Uids []int32 - Gids []int32 + Uids []uint32 + Gids []uint32 MemInfo *process.MemoryInfoStat Cmdline []string } diff --git a/pkg/security/utils/proc_linux.go b/pkg/security/utils/proc_linux.go index 5868a0a958457..1ee6765ae737e 100644 --- a/pkg/security/utils/proc_linux.go +++ b/pkg/security/utils/proc_linux.go @@ -21,7 +21,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/util/kernel" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" ) // Getpid returns the current process ID in the host namespace diff --git a/pkg/serializer/go.mod b/pkg/serializer/go.mod index 6975af71a3a78..545b645414136 100644 --- a/pkg/serializer/go.mod +++ b/pkg/serializer/go.mod @@ -123,7 +123,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -132,6 +132,7 @@ require ( github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -160,8 +161,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/pkg/serializer/go.sum b/pkg/serializer/go.sum index 8260879f5cb4d..74a1c5f4717db 100644 --- a/pkg/serializer/go.sum +++ b/pkg/serializer/go.sum @@ -10,8 +10,8 @@ github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdus github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= @@ -54,6 +54,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -222,12 +224,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/serializer/internal/metrics/origin_mapping.go b/pkg/serializer/internal/metrics/origin_mapping.go index 6b64e3e602078..45e433d7135b5 100644 --- a/pkg/serializer/internal/metrics/origin_mapping.go +++ b/pkg/serializer/internal/metrics/origin_mapping.go @@ -307,6 +307,7 @@ func metricSourceToOriginCategory(ms metrics.MetricSource) int32 { metrics.MetricSourceYarn, metrics.MetricSourceZk, metrics.MetricSourceAwsNeuron, + metrics.MetricSourceNvidiaNim, metrics.MetricSourceMilvus: return 11 // integrationMetrics default: @@ -899,6 +900,8 @@ func metricSourceToOriginService(ms metrics.MetricSource) int32 { return 419 case metrics.MetricSourceMilvus: return 425 + case metrics.MetricSourceNvidiaNim: + return 426 default: return 0 } diff --git a/pkg/trace/go.mod b/pkg/trace/go.mod index 382915cd7b380..9a1f316511e3a 100644 --- a/pkg/trace/go.mod +++ b/pkg/trace/go.mod @@ -32,7 +32,6 @@ require ( github.com/google/gofuzz v1.2.0 github.com/google/uuid v1.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 - github.com/shirou/gopsutil/v3 v3.24.4 github.com/stretchr/testify v1.10.0 github.com/tinylib/msgp v1.2.4 github.com/vmihailenco/msgpack/v4 v4.3.13 @@ -52,7 +51,10 @@ require ( k8s.io/apimachinery v0.31.2 ) -require go.opentelemetry.io/collector/component/componenttest v0.115.0 +require ( + github.com/shirou/gopsutil/v4 v4.24.11 + go.opentelemetry.io/collector/component/componenttest v0.115.0 +) require go.opentelemetry.io/collector/processor v0.115.0 // indirect @@ -66,6 +68,7 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -85,8 +88,6 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shoenig/test v1.7.1 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect github.com/vmihailenco/tagparser v0.1.2 // indirect diff --git a/pkg/trace/go.sum b/pkg/trace/go.sum index 5d3d0d4a89d22..f4ee6919325a7 100644 --- a/pkg/trace/go.sum +++ b/pkg/trace/go.sum @@ -64,7 +64,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -101,7 +100,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -134,7 +132,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= @@ -149,15 +146,8 @@ github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU= -github.com/shirou/gopsutil/v3 v3.24.4 h1:dEHgzZXt4LMNm+oYELpzl9YCqV65Yr/6SfrvgRBtXeU= -github.com/shirou/gopsutil/v3 v3.24.4/go.mod h1:lTd2mdiOspcqLgAnr9/nGi71NkeMpWKdmhuxm9GusH8= github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -174,16 +164,12 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tinylib/msgp v1.2.4 h1:yLFeUGostXXSGW5vxfT5dXG/qzkn4schv2I7at5+hVU= github.com/tinylib/msgp v1.2.4/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= github.com/vmihailenco/msgpack/v4 v4.3.13 h1:A2wsiTbvp63ilDaWmsk2wjx6xZdxQOvpiNlKBGKKXKI= @@ -369,9 +355,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/pkg/trace/stats/oteltest/go.mod b/pkg/trace/stats/oteltest/go.mod index e80c6fc27dccd..1880e691cf094 100644 --- a/pkg/trace/stats/oteltest/go.mod +++ b/pkg/trace/stats/oteltest/go.mod @@ -40,6 +40,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -61,8 +62,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/tinylib/msgp v1.2.4 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect diff --git a/pkg/trace/stats/oteltest/go.sum b/pkg/trace/stats/oteltest/go.sum index 520e6d9e0d851..d1dd6e5377312 100644 --- a/pkg/trace/stats/oteltest/go.sum +++ b/pkg/trace/stats/oteltest/go.sum @@ -34,6 +34,8 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -99,12 +101,8 @@ github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= diff --git a/pkg/trace/watchdog/cpu.go b/pkg/trace/watchdog/cpu.go index a1799701ab3d1..a2feda3f58d32 100644 --- a/pkg/trace/watchdog/cpu.go +++ b/pkg/trace/watchdog/cpu.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/DataDog/datadog-agent/pkg/trace/log" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" ) func getpid() int { diff --git a/pkg/util/filesystem/disk.go b/pkg/util/filesystem/disk.go index a80165d0ca872..a851bcd1dfb2d 100644 --- a/pkg/util/filesystem/disk.go +++ b/pkg/util/filesystem/disk.go @@ -6,7 +6,7 @@ package filesystem -import "github.com/shirou/gopsutil/v3/disk" +import "github.com/shirou/gopsutil/v4/disk" // Disk gets information about the disk type Disk struct{} diff --git a/pkg/util/filesystem/go.mod b/pkg/util/filesystem/go.mod index bc466baa93e3e..1a0effc2f07e8 100644 --- a/pkg/util/filesystem/go.mod +++ b/pkg/util/filesystem/go.mod @@ -13,7 +13,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 - github.com/shirou/gopsutil/v3 v3.24.5 + github.com/shirou/gopsutil/v4 v4.24.11 github.com/stretchr/testify v1.10.0 golang.org/x/sys v0.28.0 ) @@ -23,6 +23,7 @@ require ( github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect diff --git a/pkg/util/filesystem/go.sum b/pkg/util/filesystem/go.sum index ed5847ab111d3..97cab95a8f162 100644 --- a/pkg/util/filesystem/go.sum +++ b/pkg/util/filesystem/go.sum @@ -2,6 +2,8 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -17,8 +19,8 @@ github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkB github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= diff --git a/pkg/util/flavor/go.mod b/pkg/util/flavor/go.mod index e6597dff10c65..b4cde61713931 100644 --- a/pkg/util/flavor/go.mod +++ b/pkg/util/flavor/go.mod @@ -54,10 +54,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -70,8 +71,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/util/flavor/go.sum b/pkg/util/flavor/go.sum index b60bbee1b243d..6df24d44986c1 100644 --- a/pkg/util/flavor/go.sum +++ b/pkg/util/flavor/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/util/grpc/go.mod b/pkg/util/grpc/go.mod index 8aacd9bf986f0..977343bfe3c4d 100644 --- a/pkg/util/grpc/go.mod +++ b/pkg/util/grpc/go.mod @@ -65,10 +65,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -84,8 +85,7 @@ require ( github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/util/grpc/go.sum b/pkg/util/grpc/go.sum index f3926160d06fa..6467120987601 100644 --- a/pkg/util/grpc/go.sum +++ b/pkg/util/grpc/go.sum @@ -3,8 +3,8 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -44,6 +44,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -189,12 +191,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/util/http/go.mod b/pkg/util/http/go.mod index 561ab50ecabe4..39e32393df50d 100644 --- a/pkg/util/http/go.mod +++ b/pkg/util/http/go.mod @@ -56,10 +56,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -72,8 +73,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/util/http/go.sum b/pkg/util/http/go.sum index d12b0ce7595dd..d2f68d6435b82 100644 --- a/pkg/util/http/go.sum +++ b/pkg/util/http/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/util/ktime/resolver.go b/pkg/util/ktime/resolver.go index 36cfda9f166fa..e4f83638dafa6 100644 --- a/pkg/util/ktime/resolver.go +++ b/pkg/util/ktime/resolver.go @@ -13,7 +13,7 @@ import ( _ "unsafe" // unsafe import to call nanotime() which should be 2x quick than time.Now() - "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v4/host" ) // Resolver converts kernel monotonic timestamps to absolute times diff --git a/pkg/util/log/setup/go.mod b/pkg/util/log/setup/go.mod index 11b3815ca0a92..f865653e53d51 100644 --- a/pkg/util/log/setup/go.mod +++ b/pkg/util/log/setup/go.mod @@ -56,9 +56,10 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -71,8 +72,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/pkg/util/log/setup/go.sum b/pkg/util/log/setup/go.sum index b60bbee1b243d..6df24d44986c1 100644 --- a/pkg/util/log/setup/go.sum +++ b/pkg/util/log/setup/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -167,12 +169,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/util/process_file_stats_linux.go b/pkg/util/process_file_stats_linux.go index 7da505889c0d3..79ef22922dc24 100644 --- a/pkg/util/process_file_stats_linux.go +++ b/pkg/util/process_file_stats_linux.go @@ -11,7 +11,7 @@ import ( "os" "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/process" ) // GetProcessFileStats returns the number of file handles the Agent process has open diff --git a/pkg/util/system/cpu_unix.go b/pkg/util/system/cpu_unix.go index c963b5e914692..124fa24e74474 100644 --- a/pkg/util/system/cpu_unix.go +++ b/pkg/util/system/cpu_unix.go @@ -8,7 +8,7 @@ package system import ( - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" ) func init() { diff --git a/pkg/util/system/go.mod b/pkg/util/system/go.mod index 19c8faadba063..b91b137b720c2 100644 --- a/pkg/util/system/go.mod +++ b/pkg/util/system/go.mod @@ -17,7 +17,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 - github.com/shirou/gopsutil/v3 v3.24.5 + github.com/shirou/gopsutil/v4 v4.24.11 github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 golang.org/x/sys v0.28.0 @@ -28,13 +28,12 @@ require ( github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shoenig/test v1.7.1 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect diff --git a/pkg/util/system/go.sum b/pkg/util/system/go.sum index 5b8aa8f5cf5c1..5dc55f7f10161 100644 --- a/pkg/util/system/go.sum +++ b/pkg/util/system/go.sum @@ -2,6 +2,8 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -22,12 +24,8 @@ github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkB github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= diff --git a/pkg/util/uuid/go.mod b/pkg/util/uuid/go.mod index 36c2bd314e410..ad2e7ef2c7f0a 100644 --- a/pkg/util/uuid/go.mod +++ b/pkg/util/uuid/go.mod @@ -11,7 +11,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/util/cache v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 - github.com/shirou/gopsutil/v3 v3.24.5 + github.com/shirou/gopsutil/v4 v4.24.11 golang.org/x/sys v0.28.0 ) @@ -19,12 +19,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shoenig/test v1.7.1 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect diff --git a/pkg/util/uuid/go.sum b/pkg/util/uuid/go.sum index 45f247c1429f6..2e5f8b7759901 100644 --- a/pkg/util/uuid/go.sum +++ b/pkg/util/uuid/go.sum @@ -2,6 +2,8 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -22,12 +24,8 @@ github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkB github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= diff --git a/pkg/util/uuid/uuid_nix.go b/pkg/util/uuid/uuid_nix.go index 508f8da6dc4ff..9f8eb0ab85065 100644 --- a/pkg/util/uuid/uuid_nix.go +++ b/pkg/util/uuid/uuid_nix.go @@ -8,7 +8,7 @@ package uuid import ( - gopsutilhost "github.com/shirou/gopsutil/v3/host" + gopsutilhost "github.com/shirou/gopsutil/v4/host" "github.com/DataDog/datadog-agent/pkg/util/cache" "github.com/DataDog/datadog-agent/pkg/util/log" diff --git a/releasenotes/notes/Add-metrics-origins-for-Nvidia-Nim-integration.-8c799e83d78947b0.yaml b/releasenotes/notes/Add-metrics-origins-for-Nvidia-Nim-integration.-8c799e83d78947b0.yaml new file mode 100644 index 0000000000000..6bec889b9c4e7 --- /dev/null +++ b/releasenotes/notes/Add-metrics-origins-for-Nvidia-Nim-integration.-8c799e83d78947b0.yaml @@ -0,0 +1,11 @@ +# Each section from every release note are combined when the +# CHANGELOG.rst is rendered. So the text needs to be worded so that +# it does not depend on any information only available in another +# section. This may mean repeating some details, but each section +# must be readable independently of the other. +# +# Each section note must be formatted as reStructuredText. +--- +features: + - | + Add metrics origins for Nvidia Nim integration. diff --git a/tasks/libs/common/omnibus.py b/tasks/libs/common/omnibus.py index b60b710ff384b..38208c6a4d1fe 100644 --- a/tasks/libs/common/omnibus.py +++ b/tasks/libs/common/omnibus.py @@ -97,7 +97,7 @@ def env_filter(item): "CHANNEL", "CHART", "CI", - "CLUSTER", + "CLUSTERS", "CODECOV", "CODECOV_TOKEN", "COMPUTERNAME", @@ -115,7 +115,9 @@ def env_filter(item): "GENERAL_ARTIFACTS_CACHE_BUCKET_URL", "GET_SOURCES_ATTEMPTS", "GO_TEST_SKIP_FLAKE", + "GONOSUMDB", "HELM_HOOKS_CI_IMAGE", + "HELM_HOOKS_PERIODICAL_REBUILD_CONDUCTOR_ENV", "HOME", "HOSTNAME", "HOST_IP", @@ -134,9 +136,11 @@ def env_filter(item): "MANPATH", "MESSAGE", "NEW_CLUSTER", + "NEW_CLUSTER_PR_SLACK_WORKFLOW_WEBHOOK", "OLDPWD", "PCP_DIR", "PACKAGE_ARCH", + "PIP_EXTRA_INDEX_URL", "PIP_INDEX_URL", "PROCESS_S3_BUCKET", "PWD", diff --git a/tasks/libs/common/worktree.py b/tasks/libs/common/worktree.py index 74dd5e04e4877..e8c9d740f07bc 100644 --- a/tasks/libs/common/worktree.py +++ b/tasks/libs/common/worktree.py @@ -5,6 +5,7 @@ """ import os +import sys from contextlib import contextmanager from pathlib import Path @@ -27,7 +28,7 @@ def init_env(ctx, branch: str | None = None): """ if not WORKTREE_DIRECTORY.is_dir(): - print(f'{color_message("Info", Color.BLUE)}: Cloning datadog agent into {WORKTREE_DIRECTORY}') + print(f'{color_message("Info", Color.BLUE)}: Cloning datadog agent into {WORKTREE_DIRECTORY}', file=sys.stderr) remote = ctx.run("git remote get-url origin", hide=True).stdout.strip() # Try to use this option to reduce cloning time if all( diff --git a/tasks/new_e2e_tests.py b/tasks/new_e2e_tests.py index cf4b99caec7e6..74f027afd1582 100644 --- a/tasks/new_e2e_tests.py +++ b/tasks/new_e2e_tests.py @@ -111,7 +111,14 @@ def run( test_run_arg = f"-run {test_run_name}" cmd = f'gotestsum --format {gotestsum_format} ' - cmd += '{junit_file_flag} {json_flag} --packages="{packages}" -- -ldflags="-X {REPO_PATH}/test/new-e2e/tests/containers.GitCommit={commit}" {verbose} -mod={go_mod} -vet=off -timeout {timeout} -tags "{go_build_tags}" {nocache} {run} {skip} {test_run_arg} -args {osversion} {platform} {major_version} {arch} {flavor} {cws_supported_osversion} {src_agent_version} {dest_agent_version} {keep_stacks} {extra_flags}' + scrubber_raw_command = "" + # Scrub the test output to avoid leaking API or APP keys when running in the CI + if running_in_ci(): + scrubber_raw_command = ( + # Using custom go command piped with scrubber sed instructions https://github.com/gotestyourself/gotestsum#custom-go-test-command + f"--raw-command {os.path.join(os.path.dirname(__file__), 'tools', 'gotest-scrubbed.sh')} {{packages}}" + ) + cmd += f'{{junit_file_flag}} {{json_flag}} --packages="{{packages}}" {scrubber_raw_command} -- -ldflags="-X {{REPO_PATH}}/test/new-e2e/tests/containers.GitCommit={{commit}}" {{verbose}} -mod={{go_mod}} -vet=off -timeout {{timeout}} -tags "{{go_build_tags}}" {{nocache}} {{run}} {{skip}} {{test_run_arg}} -args {{osversion}} {{platform}} {{major_version}} {{arch}} {{flavor}} {{cws_supported_osversion}} {{src_agent_version}} {{dest_agent_version}} {{keep_stacks}} {{extra_flags}}' args = { "go_mod": "readonly", diff --git a/tasks/tools/gotest-scrubbed.sh b/tasks/tools/gotest-scrubbed.sh new file mode 100755 index 0000000000000..25ffaf544dd11 --- /dev/null +++ b/tasks/tools/gotest-scrubbed.sh @@ -0,0 +1,7 @@ +#!/bin/bash +### This script is used to run go test and scrub the output, the command can be used as follow: +### ./gotest-scrubbed.sh -- +set -euo pipefail +go test -json "$1" "${@:3}" | +sed -E 's/\b[a-fA-F0-9]{27}([a-fA-F0-9]{5})\b/**************************\1/g' | # Scrub API keys +sed -E 's/\b[a-fA-F0-9]{35}([a-fA-F0-9]{5})\b/************************************\1/g' # Scrub APP keys diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index f42ee4e61a984..e8dde1fd6d8b6 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -58,7 +58,7 @@ require ( // `TEST_INFRA_DEFINITIONS_BUILDIMAGES` matches the commit sha in the module version // Example: github.com/DataDog/test-infra-definitions v0.0.0-YYYYMMDDHHmmSS-0123456789AB // => TEST_INFRA_DEFINITIONS_BUILDIMAGES: 0123456789AB - github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3 + github.com/DataDog/test-infra-definitions v0.0.0-20241211124138-9c7c5005ca28 github.com/aws/aws-sdk-go-v2 v1.32.5 github.com/aws/aws-sdk-go-v2/config v1.28.5 github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0 @@ -74,8 +74,7 @@ require ( github.com/pkg/sftp v1.13.6 github.com/pulumi/pulumi-aws/sdk/v6 v6.56.1 github.com/pulumi/pulumi-awsx/sdk/v2 v2.16.1 - github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1 // indirect - github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1 + github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.18.3 github.com/pulumi/pulumi/sdk/v3 v3.140.0 github.com/samber/lo v1.47.0 github.com/stretchr/testify v1.10.0 @@ -303,13 +302,13 @@ require ( github.com/moby/docker-image-spec v1.3.1 // indirect github.com/onsi/ginkgo/v2 v2.20.2 // indirect github.com/onsi/gomega v1.34.1 // indirect - github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.67.0 // indirect - github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0 // indirect - github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.67.0 // indirect + github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.73.1 // indirect + github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.73.1 // indirect + github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.73.1 // indirect github.com/pulumi/pulumi-azure-native-sdk/managedidentity/v2 v2.73.1 // indirect - github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.67.0 // indirect + github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.73.1 // indirect github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1 // indirect - github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1 // indirect + github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0 // indirect github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0 // indirect github.com/twinj/uuid v0.0.0-20151029044442-89173bcdda19 // indirect github.com/x448/float16 v0.8.4 // indirect diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index 2942cca211484..516b220165409 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -17,8 +17,8 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 h1:EbzDX8HPk5uE2FsJYxD74QmMw0/3CqSKhEr6teh0ncQ= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= -github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3 h1:s+bNaiOoY3W7vCSQVqD4mU3mrtXsbkeRX+vVTwCyStQ= -github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3/go.mod h1:7nVt9okOqKKC9B9YfKqk4jitYuv1I3q2Cd/yZWuViZU= +github.com/DataDog/test-infra-definitions v0.0.0-20241211124138-9c7c5005ca28 h1:LaZgAke+RN4wBKNl+R10ewdtKe/C2MJCbp9ozXKlLP8= +github.com/DataDog/test-infra-definitions v0.0.0-20241211124138-9c7c5005ca28/go.mod h1:blPG0VXBgk1oXm2+KHMTMyR0sNI2jv51FACAYPNQvNo= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= @@ -405,30 +405,28 @@ github.com/pulumi/pulumi-aws/sdk/v6 v6.56.1 h1:wA38Ep4sEphX+3YGwFfaxRHs7NQv8dNOb github.com/pulumi/pulumi-aws/sdk/v6 v6.56.1/go.mod h1:m/ejZ2INurqq/ncDjJfgC1Ff/lnbt0J/uO33BnPVots= github.com/pulumi/pulumi-awsx/sdk/v2 v2.16.1 h1:6082hB+ILpPB/0V5F+LTmHbX1BO54tCVOQCVOL/FYI4= github.com/pulumi/pulumi-awsx/sdk/v2 v2.16.1/go.mod h1:z2bnBPHNYfk72IW1P01H9qikBtBSBhCwi3QpH6Y/38Q= -github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.67.0 h1:mgmmbFEoc1YOu81K9Bl/MVWE8cGloEdiCeIw394vXcM= -github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.67.0/go.mod h1:WmvulRFoc+dOk/el9y6u7z3CvA+yljL8HJXajmvZTYo= -github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0 h1:MFOd6X9FPlixzriy14fBHv7pFCCh/mu1pwHtSSjqfJ4= -github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0/go.mod h1:453Ff5wNscroYfq+zxME7Nbt7HdZv+dh0zLZwLyGBws= -github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.67.0 h1:jvruQQSO1ESk7APFQ3mAge7C9SWKU9nbBHrilcyeSGU= -github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.67.0/go.mod h1:d5nmekK1mrjM9Xo/JGGVlAs7mqqftBo3DmKji+1zbmw= +github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.73.1 h1:miIJy4njnFYw7VxMLvEztoMPr9zYC2kqBTwRlaFAf48= +github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.73.1/go.mod h1:LR1QBq0C1NIhmD9E0uKozCAu32j5qsamhrIsTSNVMS8= +github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.73.1 h1:79HTKSE1uJQolCRUHRFnIbSPNSIhxekIhznHnjpLi6s= +github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.73.1/go.mod h1:sN7rQ3n6T/KGaQqMXdoERPjiKzE8L89H6sFj1CSFk/U= +github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.73.1 h1:8xyjq2nYeBNwqdIf0Su2DHprEMbW0Rs82ZliFNY+14o= +github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.73.1/go.mod h1:UYRkyT4qRuQ39GPtyxE509zTVwbfunE/32npB0bhr1E= github.com/pulumi/pulumi-azure-native-sdk/managedidentity/v2 v2.73.1 h1:rkNZDAik+qlIhbmFoa09ln/oJMXey5+olw8ShmljgXc= github.com/pulumi/pulumi-azure-native-sdk/managedidentity/v2 v2.73.1/go.mod h1:P/N/xG2lVxsHdspmKjH+d8d4ln+2arXBmOl3zhjWnnw= -github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.67.0 h1:r26Xl6FdOJnbLs1ny9ekuRjFxAocZK8jS8SLrgXKEFE= -github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.67.0/go.mod h1:8yXZtmHe2Zet5pb8gZ7D730d0VAm4kYUdwCj7sjhz6g= +github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.73.1 h1:glI1LKNu/erhOZpHq7/tdwMwerZxHKv6Xaaz4ILvKAs= +github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.73.1/go.mod h1:Ckfh040vb9BE28NMNQcjYleSYAhaFhz2+E9gFYEDUGc= github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1 h1:yzXxwwq3tHdtSOi5vjKmKXq7HyKvDaKulF53MFTMbh8= github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1/go.mod h1:ChjIUNDNeN6jI33ZOivHUFqM6purDiLP01mghMGe1Fs= github.com/pulumi/pulumi-command/sdk v1.0.1 h1:ZuBSFT57nxg/fs8yBymUhKLkjJ6qmyN3gNvlY/idiN0= github.com/pulumi/pulumi-command/sdk v1.0.1/go.mod h1:C7sfdFbUIoXKoIASfXUbP/U9xnwPfxvz8dBpFodohlA= github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5 h1:7OjAfgLz5PAy95ynbgPAlWls5WBe4I/QW/61TdPWRlQ= github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5/go.mod h1:XZKLFXbw13olxuztlWnmVUPYZp2a+BqzqhuMl0j/Ow8= -github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1 h1:upeongxe3/2oCO2BHq78qqQbO7SGJz9rnp/KyDmJwqs= -github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1/go.mod h1:ARGNnIZENIpDUVSX21JEQJKrESj/0u0r0iT61rpb86I= -github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1 h1:PUH/sUbJmBmHjNFNthJ/dW2+riFuJV0FhrGAwuUuRIg= -github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1/go.mod h1:OmZeji3dNMwB1qldAlaQfcfJPc2BaZyweVGH7Ej4SJg= +github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0 h1:F3xAOBZ/In4PqydTsKeg3tou/c5FZ+JTp5dQO0oMjqE= +github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0/go.mod h1:QbAamxfUpDJC81BGtyEuV0P88RrdbOjQEhbgY+OOPpg= github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0 h1:21oSj+TKlKTzQcxN9Hik7iSNNHPUQXN4s3itOnahy/w= github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0/go.mod h1:YaEZms1NgXFqGhObKVofcAeWXu2V+3t/BAXdHQZq7fU= -github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1 h1:VDX+hu+qK3fbf2FodgG5kfh2h1bHK0FKirW1YqKWkRc= -github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1/go.mod h1:e69ohZtUePLLYNLXYgiOWp0FvRGg6ya/3fsq3o00nN0= +github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.18.3 h1:quqoGsLbF7lpGpGU4mi5WfVLIAo4gfvoQeYYmemx1Dg= +github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.18.3/go.mod h1:9dBA6+rtpKmyZB3k1XryUOHDOuNdoTODFKEEZZCtrz8= github.com/pulumi/pulumi-libvirt/sdk v0.4.7 h1:/BBnqqx/Gbg2vINvJxXIVb58THXzw2lSqFqxlRSXH9M= github.com/pulumi/pulumi-libvirt/sdk v0.4.7/go.mod h1:VKvjhAm1sGtzKZruYwIhgascabEx7+oVVRCoxp/cPi4= github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 h1:39rhOe/PTUGMYia8pR5T2wbxxMt2pwrlonf0ncYKSzE= diff --git a/test/new-e2e/tests/containers/docker_test.go b/test/new-e2e/tests/containers/docker_test.go index a7d27f4fa2987..329fd2ca1a68b 100644 --- a/test/new-e2e/tests/containers/docker_test.go +++ b/test/new-e2e/tests/containers/docker_test.go @@ -9,14 +9,16 @@ import ( "context" "encoding/json" "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/infra" + "os" + "testing" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/pulumi/pulumi/sdk/v3/go/auto" "github.com/stretchr/testify/suite" - "os" - "testing" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/infra" ) type DockerSuite struct { diff --git a/test/new-e2e/tests/containers/eks_test.go b/test/new-e2e/tests/containers/eks_test.go index 6562eff6abb80..02ddc3cf4e1d4 100644 --- a/test/new-e2e/tests/containers/eks_test.go +++ b/test/new-e2e/tests/containers/eks_test.go @@ -44,6 +44,7 @@ func (suite *eksSuite) SetupSuite() { "ddagent:fakeintake": auto.ConfigValue{Value: "true"}, "ddtestworkload:deploy": auto.ConfigValue{Value: "true"}, "dddogstatsd:deploy": auto.ConfigValue{Value: "true"}, + "ddagent:dualshipping": auto.ConfigValue{Value: "true"}, } _, stackOutput, err := infra.GetStackManager().GetStackNoDeleteOnFailure( diff --git a/test/new-e2e/tests/containers/kindvm_test.go b/test/new-e2e/tests/containers/kindvm_test.go index 5282e6fd65e34..84be75e550403 100644 --- a/test/new-e2e/tests/containers/kindvm_test.go +++ b/test/new-e2e/tests/containers/kindvm_test.go @@ -38,6 +38,7 @@ func (suite *kindSuite) SetupSuite() { "ddagent:fakeintake": auto.ConfigValue{Value: "true"}, "ddtestworkload:deploy": auto.ConfigValue{Value: "true"}, "dddogstatsd:deploy": auto.ConfigValue{Value: "true"}, + "ddagent:dualshipping": auto.ConfigValue{Value: "true"}, } _, stackOutput, err := infra.GetStackManager().GetStackNoDeleteOnFailure( diff --git a/test/new-e2e/tests/cspm/cspm_test.go b/test/new-e2e/tests/cspm/cspm_test.go index 2c7a03f8b67b1..6f5d881214691 100644 --- a/test/new-e2e/tests/cspm/cspm_test.go +++ b/test/new-e2e/tests/cspm/cspm_test.go @@ -172,7 +172,7 @@ var expectedFindingsWorkerNode = findings{ var values string func TestCSPM(t *testing.T) { - e2e.Run(t, &cspmTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithoutDualShipping())))) + e2e.Run(t, &cspmTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values))))) } func (s *cspmTestSuite) TestFindings() { diff --git a/test/new-e2e/tests/installer/script/all_scripts_test.go b/test/new-e2e/tests/installer/script/all_scripts_test.go index f11119346e52e..b79d99de89f1c 100644 --- a/test/new-e2e/tests/installer/script/all_scripts_test.go +++ b/test/new-e2e/tests/installer/script/all_scripts_test.go @@ -150,7 +150,7 @@ func (s *installerScriptBaseSuite) RunInstallScript(url string, params ...string func (s *installerScriptBaseSuite) RunInstallScriptWithError(url string, params ...string) error { scriptParams := append(params, "DD_API_KEY=test", "DD_INSTALLER_REGISTRY_URL_INSTALLER_PACKAGE=installtesting.datad0g.com") - _, err := s.Env().RemoteHost.Execute(fmt.Sprintf("curl -L %s > install_script; sudo -E %s bash install_script", url, strings.Join(scriptParams, " "))) + _, err := s.Env().RemoteHost.Execute(fmt.Sprintf("curl -L %s > install_script; %s bash install_script", url, strings.Join(scriptParams, " "))) return err } diff --git a/test/new-e2e/tests/installer/script/databricks_test.go b/test/new-e2e/tests/installer/script/databricks_test.go index 970d8780c58ce..7195da6805295 100644 --- a/test/new-e2e/tests/installer/script/databricks_test.go +++ b/test/new-e2e/tests/installer/script/databricks_test.go @@ -19,7 +19,7 @@ type installScriptDatabricksSuite struct { func testDatabricksScript(os e2eos.Descriptor, arch e2eos.Architecture) installerScriptSuite { s := &installScriptDatabricksSuite{ - installerScriptBaseSuite: newInstallerScriptSuite("installer", os, arch, awshost.WithoutFakeIntake()), + installerScriptBaseSuite: newInstallerScriptSuite("installer", os, arch, awshost.WithoutFakeIntake(), awshost.WithoutAgent()), } s.url = fmt.Sprintf("https://installtesting.datad0g.com/%s/scripts/install-databricks.sh", s.commitHash) @@ -34,7 +34,7 @@ func (s *installScriptDatabricksSuite) TestDatabricksWorkerInstallScript() { } func (s *installScriptDatabricksSuite) TestDatabricksDriverInstallScript() { - s.RunInstallScript(s.url, "DB_IS_DRIVER=true") + s.RunInstallScript(s.url, "DB_IS_DRIVER=TRUE") state := s.host.State() state.AssertDirExists("/opt/datadog-packages/datadog-agent/7.57.2-1", 0755, "dd-agent", "dd-agent") state.AssertSymlinkExists("/opt/datadog-packages/datadog-agent/stable", "/opt/datadog-packages/datadog-agent/7.57.2-1", "root", "root") diff --git a/test/new-e2e/tests/orchestrator/apply.go b/test/new-e2e/tests/orchestrator/apply.go index f7300ddc78833..ee4e8668ab40c 100644 --- a/test/new-e2e/tests/orchestrator/apply.go +++ b/test/new-e2e/tests/orchestrator/apply.go @@ -114,6 +114,7 @@ func deployAgent(ctx *pulumi.Context, awsEnv *resAws.Environment, cluster *local if awsEnv.AgentDeploy() { customValues := fmt.Sprintf(agentCustomValuesFmt, clusterName) helmComponent, err := agent.NewHelmInstallation(awsEnv, agent.HelmInstallationArgs{ + DualShipping: true, KubeProvider: kindKubeProvider, Namespace: "datadog", ValuesYAML: pulumi.AssetOrArchiveArray{ diff --git a/test/new-e2e/tests/orchestrator/suite_test.go b/test/new-e2e/tests/orchestrator/suite_test.go index 196acb7611ea5..c159b25a868ab 100644 --- a/test/new-e2e/tests/orchestrator/suite_test.go +++ b/test/new-e2e/tests/orchestrator/suite_test.go @@ -23,6 +23,7 @@ import ( "k8s.io/client-go/tools/clientcmd" agentmodel "github.com/DataDog/agent-payload/v5/process" + "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" diff --git a/test/new-e2e/tests/otel/otel-agent/complete_test.go b/test/new-e2e/tests/otel/otel-agent/complete_test.go index 357a6e754cee6..d3359aae3cb87 100644 --- a/test/new-e2e/tests/otel/otel-agent/complete_test.go +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -39,7 +39,7 @@ agents: value: 'false' ` t.Parallel() - e2e.Run(t, &completeTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) + e2e.Run(t, &completeTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) } func (s *completeTestSuite) SetupSuite() { diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go index 4bbfc390a861b..81b57d87917d9 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go @@ -32,7 +32,7 @@ datadog: containerCollectUsingFiles: false ` t.Parallel() - e2e.Run(t, &iaEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner(awskubernetes.WithEKSOptions(eks.WithLinuxNodeGroup()), awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) + e2e.Run(t, &iaEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner(awskubernetes.WithEKSOptions(eks.WithLinuxNodeGroup()), awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } var eksParams = utils.IAParams{ @@ -78,7 +78,7 @@ datadog: containerCollectUsingFiles: false ` t.Parallel() - e2e.Run(t, &iaUSTEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner(awskubernetes.WithEKSOptions(eks.WithLinuxNodeGroup()), awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) + e2e.Run(t, &iaUSTEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner(awskubernetes.WithEKSOptions(eks.WithLinuxNodeGroup()), awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } func (s *iaUSTEKSTestSuite) SetupSuite() { diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go index cf330ff1ba7ea..b0706f90e10ba 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go @@ -34,7 +34,7 @@ datadog: containerCollectUsingFiles: false ` t.Parallel() - e2e.Run(t, &iaTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) + e2e.Run(t, &iaTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } var iaParams = utils.IAParams{ diff --git a/test/new-e2e/tests/otel/otel-agent/minimal_test.go b/test/new-e2e/tests/otel/otel-agent/minimal_test.go index 47c0076ffce3a..9377c56fd514f 100644 --- a/test/new-e2e/tests/otel/otel-agent/minimal_test.go +++ b/test/new-e2e/tests/otel/otel-agent/minimal_test.go @@ -43,7 +43,7 @@ datadog: containerCollectUsingFiles: false ` t.Parallel() - e2e.Run(t, &minimalTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig))))) + e2e.Run(t, &minimalTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig))))) } var minimalParams = utils.IAParams{ diff --git a/test/new-e2e/tests/otel/otel-agent/receive_resource_spans_v2_test.go b/test/new-e2e/tests/otel/otel-agent/receive_resource_spans_v2_test.go index d551b53b7e82b..aa9e8163e1664 100644 --- a/test/new-e2e/tests/otel/otel-agent/receive_resource_spans_v2_test.go +++ b/test/new-e2e/tests/otel/otel-agent/receive_resource_spans_v2_test.go @@ -36,7 +36,7 @@ agents: value: 'false' ` t.Parallel() - e2e.Run(t, &otelAgentSpanReceiverV2TestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig))))) + e2e.Run(t, &otelAgentSpanReceiverV2TestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig))))) } func (s *otelAgentSpanReceiverV2TestSuite) SetupSuite() { diff --git a/test/new-e2e/tests/otel/otel-agent/sampling_test.go b/test/new-e2e/tests/otel/otel-agent/sampling_test.go index 98133826ee708..99f92bc32cc63 100644 --- a/test/new-e2e/tests/otel/otel-agent/sampling_test.go +++ b/test/new-e2e/tests/otel/otel-agent/sampling_test.go @@ -27,7 +27,7 @@ var samplingConfig string func TestOTelAgentSampling(t *testing.T) { t.Parallel() - e2e.Run(t, &samplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(samplingConfig))))) + e2e.Run(t, &samplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(samplingConfig))))) } func (s *samplingTestSuite) TestSampling() { diff --git a/test/new-e2e/tests/otel/otlp-ingest/operation_and_resource_name_logic_v2_test.go b/test/new-e2e/tests/otel/otlp-ingest/operation_and_resource_name_logic_v2_test.go index 8c3ef3508799a..89a30686706be 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/operation_and_resource_name_logic_v2_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/operation_and_resource_name_logic_v2_test.go @@ -41,7 +41,7 @@ agents: value: 'enable_operation_and_resource_name_logic_v2' ` t.Parallel() - e2e.Run(t, &otlpIngestOpNameV2RecvrV1TestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) + e2e.Run(t, &otlpIngestOpNameV2RecvrV1TestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values))))) } func (s *otlpIngestOpNameV2RecvrV1TestSuite) SetupSuite() { @@ -78,7 +78,7 @@ agents: value: 'enable_operation_and_resource_name_logic_v2,enable_receive_resource_spans_v2' ` t.Parallel() - e2e.Run(t, &otlpIngestOpNameV2RecvrV2TestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) + e2e.Run(t, &otlpIngestOpNameV2RecvrV2TestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values))))) } func (s *otlpIngestOpNameV2RecvrV2TestSuite) SetupSuite() { @@ -117,7 +117,7 @@ agents: value: 'true' ` t.Parallel() - e2e.Run(t, &otlpIngestOpNameV2SpanAsResNameTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) + e2e.Run(t, &otlpIngestOpNameV2SpanAsResNameTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values))))) } func (s *otlpIngestOpNameV2SpanAsResNameTestSuite) SetupSuite() { @@ -157,7 +157,7 @@ agents: ` t.Parallel() ts := &otlpIngestOpNameV2RemappingTestSuite{} - e2e.Run(t, ts, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) + e2e.Run(t, ts, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values))))) } func (s *otlpIngestOpNameV2RemappingTestSuite) SetupSuite() { diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go index 0db1211c09749..62b882e4def47 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go @@ -46,7 +46,7 @@ agents: value: '50' ` t.Parallel() - e2e.Run(t, &otlpIngestSamplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) + e2e.Run(t, &otlpIngestSamplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values))))) } func (s *otlpIngestSamplingTestSuite) TestSampling() { diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index b91361b7e9866..eb1e879491051 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -43,7 +43,7 @@ agents: value: 'true' ` t.Parallel() - e2e.Run(t, &otlpIngestTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) + e2e.Run(t, &otlpIngestTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values))))) } var otlpIngestParams = utils.IAParams{ diff --git a/test/new-e2e/tests/otel/otlp-ingest/receive_resource_spans_v2_test.go b/test/new-e2e/tests/otel/otlp-ingest/receive_resource_spans_v2_test.go index dbe8642df94fd..5f83e4dba06cf 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/receive_resource_spans_v2_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/receive_resource_spans_v2_test.go @@ -41,7 +41,7 @@ agents: value: 'enable_receive_resource_spans_v2' ` t.Parallel() - e2e.Run(t, &otlpIngestSpanReceiverV2TestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) + e2e.Run(t, &otlpIngestSpanReceiverV2TestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values))))) } func (s *otlpIngestSpanReceiverV2TestSuite) SetupSuite() { diff --git a/test/otel/go.mod b/test/otel/go.mod index a20206bf8391a..3bb758c1620d7 100644 --- a/test/otel/go.mod +++ b/test/otel/go.mod @@ -182,7 +182,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/viper v1.14.0 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/benbjohnson/clock v1.3.5 // indirect @@ -196,6 +196,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect @@ -248,8 +249,7 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/rs/cors v1.11.1 // indirect github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect - github.com/shirou/gopsutil/v3 v3.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect diff --git a/test/otel/go.sum b/test/otel/go.sum index a2ed9a90d5779..2fcc58afcf90e 100644 --- a/test/otel/go.sum +++ b/test/otel/go.sum @@ -26,8 +26,8 @@ github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdus github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= github.com/DataDog/sketches-go v1.4.6 h1:acd5fb+QdUzGrosfNLwrIhqyrbMORpvBy7mE+vHlT3I= github.com/DataDog/sketches-go v1.4.6/go.mod h1:7Y8GN8Jf66DLyDhc94zuWA3uHEt/7ttt8jHOBWWrSOg= -github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= -github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/DataDog/viper v1.14.0 h1:dIjTe/uJiah+QFqFZ+MXeqgmUvWhg37l37ZxFWxr3is= +github.com/DataDog/viper v1.14.0/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -85,6 +85,8 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -307,12 +309,8 @@ github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= -github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=